Mathematica provides convenient functions and algorithms for manipulating colors in images, with full generality for arbitrary numbers of color channels.
ImageAdjust — adjust levels, brightness, contrast, gamma, etc.
ImageHistogram — histogram of levels by channel
ImageLevels — tally of levels in each channel
ColorConvert — convert between color spaces
ColorSeparate,
ColorCombine — separate, combine color channels
ColorNegate — negate color values
Binarize — reduce any image to black and white
ColorQuantize — reduce the color palette of an image
AlphaChannel — the alpha channel of the image
ImageApply — apply an arbitrary function to each pixel value
Colorize — create pseudocolor images
ReliefImage — create an image from data using simulated relief
ColorData — data on a large number of useful color schemes