Image Processing Toolbox User's Guide Previous page   Next Page
applycform

Apply color space transformation

Syntax

Description

out = applycform(I,C) converts the color values in I to the color space specified in the color transformation structure C. The color transformation structure specifies various parameters of the transformation. See makecform for details.

If I is two-dimensional, each row is interpreted as a color. I typically has either three or four columns, depending on the input color space. out has the same number of rows and either three or four columns, depending on the output color space.

If I is three-dimensional, each row-column location is interpreted as a color, and size(I,3) is typically either three or four, depending on the input color space. out has the same number of rows and columns as I, and size(out,3) is either three or four, depending on the output color space.

Class Support

I must be a real, nonsparse, finite array of class uint8, uint16, or double. The output array out has the same class and size as the input array, unless the output color space is XYZ. If the input is XYZ data of class uint8, the output is of class uint16, because there is no standard 8-bit encoding defined for XYZ color values.

Example

Read in a color image that uses the RGB color space.

Create a color transformation structure that defines an RGB to XYZ conversion.

Perform the transformation with applycform.

See Also

lab2double, lab2uint8, lab2uint16, makecform, whitepoint, xyz2double, xyz2uint16

For a full list of the toolbox color space conversion functions, see Color Space Conversions.


Previous page  adapthisteq applylut Next page

© 1994-2005 The MathWorks, Inc.