[JAVA2D] setting color with Graphics2D on a BufferedImage with IndexColorModel
I hava a BufferedImage from a GIF, the ColorModel is a IndexColorModel .
Since i finally want to write back the modified image to a GIF , i don't
want to change the color model, especially my application need to absolutely
keep the palette as it is used in the original GIF.
Then i did create a Graphics2d from this BufferedImage.
Then i call setColor() and drawString().
My problem: if I use a color that is not contained in the palette, or if I
call drawString() with font antialiasing , which will produce pixels with a
color not contained in the palette. How is are these new colors mapped to
the palette color?
Or how can i controll this mapping ?
Unfortunately I did not found the source code from SunGraphics2D , so that I
can see myself what exactly is goning on inside when calling setColor and
drawSting und the circumstances described above.
Any ideas where I can get the source code from ?
To unsubscribe, send email to firstname.lastname@example.org and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
email@example.com and include in the body of the message "help".