Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JAI ColorConvertDescriptor, ColorMapOpImage, IndexColorModel anddefine one color as transparent

Reply
Thread Tools

JAI ColorConvertDescriptor, ColorMapOpImage, IndexColorModel anddefine one color as transparent

 
 
Bernhard Messerer
Guest
Posts: n/a
 
      08-11-2003
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

 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      08-14-2003
On Mon, 11 Aug 2003 09:49:13 +0200, Bernhard Messerer
<(E-Mail Removed)> wrote or quoted :

>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.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert BufferedImage from DirectColorModel to IndexColorModel Philipp Java 4 12-12-2006 09:00 AM
Error when creating BufferedImage with IndexColorModel from a byte array. weisburd@gmail.com Java 1 10-11-2006 07:51 PM
converting DirectColorModel to IndexColorModel bonkura_ Java 3 10-22-2005 03:28 AM
Problem with IndexColorModel in Mac OS X Martin Chan Java 0 02-17-2004 05:03 AM
Painting with Graphics2D and an IndexColorModel... Michael C. Gilson Java 4 08-30-2003 11:43 PM



Advertisments