Apply device-independent color space transformation
B = applycform(A,C)
B = applycform(A,C) converts
the color values in
A to the color space specified
in the color transformation structure
C. The color
transformation structure specifies various parameters of the transformation.
makecform for details.
A is two-dimensional, each row is interpreted
as a color unless the color transformation structure contains a grayscale
ICC profile. (See Note for this case.)
A can have
1 or more columns, depending on the input color space.
the same number of rows and 1 or more columns, depending on the output
color space. (The ICC spec currently supports up to 15-channel device
A is three-dimensional, each row-column
location is interpreted as a color, and
typically 1 or more, depending on the input color space.
the same number of rows and columns as A, and
1 or more, depending on the output color space.
A is a real, nonsparse array of class
double or a string.
only a string if
C was created with the following
C = makecform('named', profile, space)
The output array
B has the same class as
unless the output space is XYZ. If the input
is XYZ data of class
the output is of class
uint16, because there is
no standard 8-bit encoding defined for XYZ color
If the color transformation structure
Read in a color image that uses the sRGB color space.
rgb = imread('peppers.png');
Create a color transformation structure that defines an sRGB to L*a*b* conversion.
C = makecform('srgb2lab');
Perform the transformation with
lab = applycform(rgb,C);