
On Mon, 20 Aug 2007 17:36:45 -0500, Aaron Spike <aaron@...749...> wrote:
I think I've seen the greatest appearance of banding when layering multiple semitransparent gradients on top of each other. Is there something that can be done about this?
That's due to rounding error since we are only working with limited precision (8 bits per component). If we wanted to reduce banding in the case where a lot of gradients are being stacked, it'd be necessary to do the entire rendering at a higher precision (say, 16 bits per component, or even using single or double-precision floating point), and then only reduce to 8-bit precision for display/output.
Adding random noise to the gradients may help reduce the visibility of artifacts to the human eye, however. Gradients are rendered by selecting colors from a precomputed 1024-color vector, so adding a very small amount of noise to that index calculation should be sufficient.
-mental