# colour

The following routines can be used to change the colour of a bitmap:

invertDib(dib)
  inverts the colors of the bitmap
makeDibGray(dib)
  makes the bitmap gray
replaceDibColor(dib, color1, color2)
  replaces color1 in the bitmap with color2.
replaceDibColors(dib, colors1, colors2)
  replaces all the colors from colors1 in the bitmap with the same color from colors2. colors1 and colors2 are sequences of colors and need to have the same length.
adjustDibColors(dib, delta)
  adds delta to the colors of the bitmap. delta should be a sequence of length 3: delta = {delta_blue, delta_green, delta_red}
colorizeDib(dib, color1)
  changes all the colors of the bitmap to color1, without changing the brightness.
adjustDibBrightness(dib, brightness)
  adjusts the brightness of the bitmap. brightness should be an integer between -255 (total black) and +255 (total white).
adjustDibContrast(dib, contrast)
  adjusts the contrast of the bitmap. contrast should be an atom between -1 and +1.
adjustDibBrightnessAndContrast(dib, brightness, contrast)
  adjusts the brightness and the contrast of the bitmap in one pass.
  If you need to change both brightness and contrast, use adjustDibBrightnessAndContrast.
  If you only need to change brightness, use adjustBrightness.
  If you only need to change contrast, use adjustContrast.