Main Content

lab2uint16

Convert L*a*b color values touint16

Description

example

lab16= lab2uint16(lab)converts L*a*b* color values to typeuint16.

Examples

collapse all

This example shows how to convert L*a*b* color values fromdoubletouint16.

创造e adoublevector specifying the color white in L*a*b* colorspace.

w = [100 0 0];

Convert the L*a*b* color value touint16.

lab2uint16(w)
ans =1x3 uint16 row vector65280 32768 32768

Input Arguments

collapse all

颜色值转换, specified as am-by-3 numeric matrix of color values (one color per row), or anm-by-n-by-3 numeric array.

Data Types:double|uint8

Output Arguments

collapse all

Converted color values, returned as a numeric array of same size as the input.

Data Types:uint16

Algorithms

The function converts the L*a*b* color values to typeuint16. The Image Processing Toolbox™ software follows the convention that double-precision L*a*b* arrays contain 1976 CIE L*a*b* values. The L*a*b* arrays that areuint8oruint16follow the convention in the ICC profile specification (ICC.1:2001-4,www.color.org) for representing L*a*b* values as unsigned 8-bit or 16-bit integers. The ICC encoding convention is illustrated by these tables.

Value (L*)

uint8Value

uint16Value

0.0

0

0

100.0

255

65280

100.0 + (25500/65280)

None

65535

Value (a* or b*)

uint8Value

uint16Value

-128.0

0

0

0.0

128

32768

127.0

255

65280

127.0 + (255/256)

None

65535

Version History

Introduced before R2006a