Hi Kjell,

  no need to use ImageOps, just create a 8-bit image and copy your
  24-bit image using drawImage.
  It should look something like this:
  BufferedImage image8b =
      new BufferedImage(image24b.getWidth(), image24b.getHeight(),
                        BufferedImage.TYPE_BYTE_INDEXED);
  Graphics g = image8b.getGraphics();
  g.drawImage(image24b, 0, 0, null);

  That should do it.

  Thank you,
    Dmitri

On Tue, Apr 01, 2003 at 09:12:02AM -0700, Kjell Roeang wrote:
 > Hi
 > I want to convert a 24 bit RGB BufferedImage to an 8 bit indexed BufferedImage
 > (perhaps using some kind of BufferedImageOp) and wondered if someone already some 
 > (fast) code for this? The RGB image will contain less 256 differrent colors.
 >
 > Regards
 >
 > Kjell Roeang
 >
 > ===========================================================================
 > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
 > of the message "signoff JAVA2D-INTEREST".  For general help, send email to
 > [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to