# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

# lab2uint16

Convert L*a*b* data to `uint16`

## Syntax

```lab16 = lab2uint16(lab) ```

## Description

`lab16 = lab2uint16(lab)` converts an M-by-3 or M-by-N-by-3 array of L*a*b* color values to `uint16`. `lab16` has the same size as `lab`.

The Image Processing Toolbox™ software follows the convention that double-precision L*a*b* arrays contain 1976 CIE L*a*b* values. L*a*b* arrays that are `uint8` or `uint16` follow 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*)

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` can be a `uint8`, `uint16`, or `double` array that must be real and nonsparse. `lab16` is of class `uint16`.

## Examples

collapse all

This example shows how to convert L*a*b* color values from `double` to `uint16`.

Create a `double` vector specifying the color white in L*a*b* colorspace.

`w = [100 0 0];`

Convert the L*a*b* color value to `uint16`.

`lab2uint16(w)`
```ans = 1x3 uint16 row vector 65280 32768 32768 ```