Accessibility

Director Article

Imaging Lingo Basics


Table of Contents

  1. Introduction
  2. The Image Object
  3. The Color Object
  4. GetPixel and SetPixel
  5. Alphas
  6. Draw and Fill
  7. CopyPixels
  8. Inks
  9. Dither
  10. Using Quads to Skew, Rotate, and Distort
  11. Masking Images
  12. Advanced Ideas, Techniques, and Resources

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.

32 bit

Figure 2. 32-bit

8-bit windows, dithered

Figure 4. 8-bit windows, dithered

8-bit Windows, no dither

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.