This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Convert XYZ color values to double


xyzD = xyz2double(xyz)



xyzD = xyz2double(xyz) converts XYZ color values to type double.


collapse all

This example shows how to convert uint16-encoded XYZ values to double.

Create a uint16 vector specifying a color in XYZ colorspace.

c = uint16([100 32768 65535]);

Convert the XYZ color value to double.

ans = 1×3

    0.0031    1.0000    2.0000

Input Arguments

collapse all

Color values to convert, specified as a m-by-3 matrix of color values (one color per row), or an m-by-n-by-3 image array. The input xyz matrix must be real and nonsparse.

Data Types: uint16

Output Arguments

collapse all

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

Data Types: double


The Image Processing Toolbox™ software follows the convention that double-precision XYZ arrays contain 1931 CIE XYZ values (2° observer). The XYZ arrays that are uint16 follow the convention in the ICC profile specification (ICC.1:2001-4, for representing XYZ values as unsigned 16-bit integers. There is no standard representation of XYZ values as unsigned 8-bit integers. The ICC encoding convention is illustrated by this table.

Value (X, Y, or Z)

uint16 Value





1.0 + (32767/32768)


Introduced before R2006a