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?
There is no specification to define how this mapping is done.
Implementations are free to do the mapping as best they can. They are even free to ignore the antialiasing hint for palette destinations since it is just a hint.
There are no really great algorithms for dealing with trying to choose the best colors from an arbitrary palette to match the arbitrary colors generated by antialiasing and alpha blending and have the results look very pleasing. We have some fairly clever code that tries to do so if you specify such an operation, but it is a compromise for speed and accuracy and in the end it is not wise to do blending and antialiasing on a palette destination.
Or how can i controll this mapping ?
Unfortunately, there are no APIs for controlling how the internal rendering equations choose their colors from the palette. It's a really arcane section of the code and it is better to invest your time in using deeper image formats than to try to optimize this behavior.
I realize that your original description of your problem specified that you needed to write back the results to a GIF, but that is really the problem right there - to choose a limited image format to store the results of some complex blending. If you have any leeway to change that constraint, then you'd be better off upgrading the image to a 24 or 32 bit format, doing the rendering there, and writing back a full color PNG or even a lossy compressed JPEG than trying to use a paletted image format and a GIF output...
...jim
=========================================================================== 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".
