Adobe, MAKE SOME NOISE

A forum thread recently challenged my knowledge (and preconceptions) of gradients in Flash. I’ve always worked under the assumption that Flash uses 8 bits per color channel – zero to 0xFF for R, G, and B – end of story. Although this is generally considered the shallow end of the color-depth pool, it’s always been more or less sufficient. The shallow color depth has long been considered the sweet spot between passable (even realistic) color recreation, and the exponential processing lode of adding more data to each pixel in a display.

The point where 8-bit graphics break down is when it comes time to interpolate a gradient. If you want to draw a smooth fade from black to 10% grey, you want as many colors in-between as there are pixels. In an 8-bit environment, you’ve only got about 26 shades of grey to work with so anything bigger than 26 pixels across is going to have blocks of pixels, all colored the same – in the biz, this is called “banding.”

ugly!

Interestingly, while Flash is bound to 8-bit it will still import a 16-bit Tiff. When I realized this I figured there must be some trickery going on - either I could use 16-bit color in Flash or else the Tiff was getting the chop. Unfortunately, it turns out Flash downsamples the image into it's own color profile, but the importer is good enough to give us the courtesy of a good dithering first (provided you enabled it in Photoshop). Here’s a little demo to show the dithering - if you squint you can see the banding on the originals.

Edit: Per Ben’s comment, I’ve tweaked the colors below to make the banding a little more noticeable (if you still see flat-black bars, try cranking up your monitor’s brightness/contrast). For all the headaches I’ve had from gradients in the past, making a bad one is really hard to reproduce on command!

2 Responses to “16bit Gradients in Flash – Almost.”

  1. Ben Garney Says:

    I think something might be wrong with your demo. It’s all black. Other than that an awesome writeup. :)

  2. Recent Faves Tagged With "gradients" : MyNetFaves Says:

    [...] | 8 days ago How to Create a Photomontage in GIMP First saved by JonRouston | 11 days ago 16bit Gradients in Flash – Almost. First saved by ipmasqman | 14 days ago links for 2008-08-28 First saved by fredlee | 43 days [...]

Leave a Reply