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

Convert data to uint8

Syntax

Description

lab8 = lab2uint8(lab) converts an M-by-3 or M-by-N-by-3 array of color values to uint8. lab8 has the same size as lab.

The Image Processing Toolbox follows the convention that double-precision arrays contain 1976 CIE values. arrays that are uint8 or uint16 follow the convention in the ICC profile specification (ICC.1:2001-4, www.color.org) for representing values as unsigned 8-bit or 16-bit integers. The ICC encoding convention is illustrated by these tables.

Value (L*)
uint8 Value
uint16 Value
0.0
0
0
100.0
255
65280
100.0 + (25500/65280)
None
65535
Value (a* or b*)
uint8 Value
uint16 Value
-128.0
0
0
0.0
128
32768
127.0
255
65280
127.0 + (255/256)
None
65535

Class Support

lab is a uint8, uint16, or double array that must be real and nonsparse. lab8 is uint8.

Example

Convert full intensity neutral color (white) from double to uint8.

See Also

applycform, lab2double, lab2uint16, makecform, whitepoint, xyz2double, xyz2uint16

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


Previous page  lab2uint16 label2rgb Next page

© 1994-2005 The MathWorks, Inc.