applycform
Apply device-independent color space transformation
Syntax
Description
Examples
Convert sRGB to L*a*b* Color Space using Applycform
Read color image that uses the sRGB color space into the workspace.
rgb = imread('peppers.png');
Create a color transformation structure that defines an sRGB to L*a*b* conversion.
C = makecform('srgb2lab');
Perform the transformation by using the applycform
function.
lab = applycform(rgb,C);
Input Arguments
A
— Input color space
2-D numeric matrix | 3-D numeric array | string | character vector
Input color space, specified as one of the following:
2-D numeric matrix.
applycform
interprets each row as a color unless the color transformation structure,C
, contains a grayscale ICC profile. In that case,applycform
interprets each pixel inA
as a color.3-D numeric matrix. Each row-column location is interpreted as a color.
size(A,3)
is typically 1 or more, depending on the input color space.string or character vector.
A
is only a string or character vector ifC
is created with the following syntax:C = makecform('named', profile, space)
Data Types: double
| uint8
| uint16
| char
| string
C
— Color transformation
structure
Color transformation, specified as a structure. The color transformation
structure specifies various parameters of the transformation. You can create
a color transformation structure using makecform
.
Output Arguments
B
— Output color space
numeric array
Output color space, returned as a numeric array. The size of
B
depends on the dimensionality and size of the
input color space, A
:
When
A
is two-dimensional,B
has the same number of rows and one or more columns, depending on the output color space. (The ICC specification currently supports up to 15-channel device spaces).When
A
is three-dimensional,B
is the same number of rows and columns asA
, andsize(B,3)
is 1 or more, depending on the output color space.
Version History
Introduced before R2006a
See Also
lab2double
| lab2uint8
| lab2uint16
| makecform
| whitepoint
| xyz2double
| xyz2uint16
Abrir ejemplo
Tiene una versión modificada de este ejemplo. ¿Desea abrir este ejemplo con sus modificaciones?
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)