JAI ColorConvertDescriptor, ColorMapOpImage, IndexColorModel anddefine one color as transparent

B

Bernhard Messerer

High all!

Same problem as I posted some days ago, but some more info... I'm now
working with JAI and think I could define a color transparent via either
the ColorConvertDescriptor or the ColorOpImage.
ColorOpImage seems to transform the palette somehow with
"transformColormap(byte[][] colormap)", but I have no idea on how to use
this to define a color as transparent (if possible).
ColorConvertDescriptor seems to convert the colors via a ColorModel, but
I have no idea on how to create this. May images (loaded TIFF images or
PNGs) seems to use an IndexColorModel (this is what getClass().getName()
says), and as I understand it I'd just have to create the same
IndexColorModel with a transparent index defined (the constructor takes
this as argument). But how to create "the same" ColorModel? And I assume
this takes more time to render then, I think best woulod be to just
replace the IndexColorModel of my TIFF image with "the same" (again,
how?) but with a transparentIndex defined (How to get this index for
e.g., white???); But how can I "replace" the ColorModel of a RenderedOp
(this is what is loaded from a file).
Is there any other way to define a color as transparent in JAI?

kind regards,

Messi
 
R

Roedy Green

Same problem as I posted some days ago, but some more info... I'm now
working with JAI and think I could define a color transparent via either
the ColorConvertDescriptor or the ColorOpImage.

I think life will be much clearer if you study the source code for
IndexedColorModel. It is really very simple.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top