Digital Image Processing allows you to manipulate color images as conveniently and easily as monochrome images. Color images may be represented in three different color formats and two different color interleaving methods, allowing you to select the most appropriate format for any color processing application.

<< ImageProcessing`

Color image modification

Consider the effect of changing contrast in the saturation and value channels of an HSV color image.

This loads the example “bean” image and converts it to the HSV color format.

A = ToHSVColor[ImageRead["beans.tif"]];

Here we split the image into three independent channels so that we may manipulate each channel.

{H, S, V} = ToChannels[A];

This decreases the saturation and increases the luminance in the respective channels.

{newS, newV} = {(S^2), ScaleLinear[(V^0.2), {0, 1}]};

This recombines the individual color channels into composite color images.

{A, FromChannels[{H, newS, V}], 
        FromChannels[{H, S, newV}]};

Here we display the original (left) and the modified images (center, right).

Show[
        GraphicsArray[(Graphics[#, 
                  PlotRange -> {0, 1}] &) /@ %]];