8.3. Color Mapping Using Color Objects

The System.Drawing.Imaging namespace provides three color objects that can be used to apply color mappings to images. These three objects are ColorMap, ColorMatrix, and ColorPalette. In this section we will discuss the use and importance of these objects.

8.3.1. The Color Remap Table

A color remap table is used to convert the existing colors of an image to new colors by applying a color mapping to them. The ColorMap class represents a color remap table. It defines the mapping between existing colors and the new colors to which they will be converted. When the map is applied to an image, any pixel of the old color is converted to the new color.

The ColorMap class has only two properties—NewColor and OldColor ...

Get Graphics Programming with GDI+ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.