JAI ColorConvertDescriptor, ColorMapOpImage, IndexColorModel anddefine one color as transparent

Discussion in 'Java' started by Bernhard Messerer, Aug 11, 2003.

  1. 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
    Bernhard Messerer, Aug 11, 2003
    #1
    1. Advertising

  2. Bernhard Messerer

    Roedy Green Guest

    Re: JAI ColorConvertDescriptor, ColorMapOpImage, IndexColorModel and define one color as transparent

    On Mon, 11 Aug 2003 09:49:13 +0200, Bernhard Messerer
    <> 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.
    Roedy Green, Aug 14, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael C. Gilson
    Replies:
    4
    Views:
    957
    Ken DeLong
    Aug 31, 2003
  2. Martin Chan
    Replies:
    0
    Views:
    571
    Martin Chan
    Feb 17, 2004
  3. bonkura_
    Replies:
    3
    Views:
    2,226
    Roedy Green
    Oct 22, 2005
  4. Replies:
    1
    Views:
    1,805
  5. Philipp
    Replies:
    4
    Views:
    5,327
    Philipp
    Dec 12, 2006
Loading...

Share This Page