Imaging Lingo Basics
Table of Contents
Dither
Dithering takes a flat area of color and creates a pattern of multiple colors to simulate the original when down-sampling an image to a lower bit depth. Director allows you to do this manually by selecting Modify > Bitmap, but you can do this in real time with imaging lingo as well. If you take a large, subtle gradient and down-sample it, you quickly see banding in the image due to the lack of sufficient colors to reproduce the same results. If you dither while down-sampling, the eye can visually blend the pixels to try to smooth the effect of colors not available in the current palette.
Figure 2. 32-bit
Figure 4. 8-bit windows, dithered
Figure 3. 8-bit Windows, no dither
i.copyPixels(myImage, i.rect, myImage.rect, [#dither : 1])
This would use basic dithering to copy the image over. There are two other undocumented dither levels you can use as well.
i.copyPixels(myImage, i.rect, myImage.rect, [#dither : 1215])
This is a slightly slower but more precise dither.
i.copyPixels(myImage, i.rect, myImage.rect, [#dither : 1969])
The slowest dither but is more exact than the other two options. This is the closest you will get to manually using the dither in Director by selecting Modify >Transform Bitmap.