> However, despite what I said in the original post what I actually
> need to do is process an Image rather than a BufferedImage.
Create the BufferedImage and then use:
Graphics2D g2d = bufimg.createGraphics();
// After making sure that gifImage is fully loaded...
g2d.drawImage(gifImage, 0, 0, null);
g2d.dispose();
// bufimg now contains a copy of gifImage in whatever
// format bufimg was created in.
> And, finally, reconstituting it with the 216-colour IndexColorModel:
>
> Image img216 = Toolkit.getDefaultToolkit().createImage(new
> MemoryImageSource(imageWidth, imageHeight, cm, pixels, 0,
> imageWidth));
The integer pixel array from the PixelGrabber contains pixel values
that are encoded as 32-bit ARGB color values. If you try to mate
that with an IndexColorModel directly then the resulting image will
try to interpret these 32-bit color values as indices into the
IndexColorModel's colormap. An apples index into an oranges array...
...jim
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 2D Home Page: http://java.sun.com/products/java-media/2D/