Logical Colors, Gamuts, and Gamut Matching
By default, Windows disables image color matching to ensure that existing
applications continue to draw color images as originally intended. You can enable
image color matching for a device context by using the
SetICMMode function. You must enable image color matching for each device context you
intend to use for output.
Once you enable image color matching, you can create a
color space and select it into the device contexts of the devices you wish to use. The
color space defines the set of logical colors that you may use to draw. For each
device, the system or the device driver transforms the logical colors to device
(or physical) colors in a way that ensures consistency across devices.
To use a color from the color space, you specify a
logical color value. The format of the value depends on the color space type. In some color
spaces, this is similar to RGB (red, green, blue) color value described in previous
Windows documentation, but the red, green, and blue components of logical color
values are defined in terms of independent colormetric measure rather than
arbitrary color units imposed by a device driver. In other cases, you may use
color values that actually contain CMYK (cyan, magenta, yellow, black) values.
Not all devices support all colors. You can determine which colors are
supported by a given device by checking its
gamut, the set of colors it can produce. Different devices have different gamuts.
For example, the screen can display cyans that no printer can produce; likewise,
there are some reds on a page that never appear on a display.
An important element of image color matching is
gamut matching, the process of finding color matches in the gamuts of different devices.
This can range from the simple (such as truncating to the surface of the printer
gamut), to the sophisticated (such as moving all colors a bit to maintain
contrasts). Matching is not simply the process of ensuring that each pixel is
faithfully reproduced with a given color. Instead, image color matching works within
the capabilities of the given output device to produce an image in which the
colors have the same relation to one another as they do when produced on other
devices.
You can determine whether given colors are within the gamut of a device by
using the
CheckColorsInGamut function. This is useful for determining whether the screen has a larger
gamut than the current printer. In such cases, you can notify the user of which
screen colors won't print. You can preview the colors of a print job on the screen
by using the
ColorMatchToTarget function. The function first uses the current color space and gamut-matching
method of a given device context, such as for a printer, to convert the colors
in an image. It then converts the converted image to display on the preview
device.
Image color matching applies to any drawing operation in which colors are
given as color values. It affects colors that you specify directly, such as when
setting the color of individual pixels using the
SetPixel function, or indirectly, when you set the colors in pens, brushes, fonts and
other graphics objects. Image color matching does not apply to device-dependent
bitmaps, such as those created by the
CreateBitmap and
CreateCompatibleBitmap functions.
- Software for developers
-
Delphi Components
.Net Components
Software for Android Developers
- More information resources
-
MegaDetailed.Net
Unix Manual Pages
Delphi Examples