trans_to_rgb
— Transform an image from an arbitrary color space to the RGB color space.
trans_to_rgb(ImageInput1, ImageInput2, ImageInput3 : ImageRed, ImageGreen, ImageBlue : ColorSpace : )
trans_to_rgb
transforms an image from an arbitrary color
space (ColorSpace
) to the RGB color space. The three
channels of the image are passed as three separate images on input
and output.
The operator trans_to_rgb
supports the image types byte, uint2,
int4, and real. The domain of the input images must match the
domain provided by a corresponding transformation with
trans_from_rgb
. If not, the results of the transformation may not
be reasonable.
This includes some scalings in the case of certain image types and transformations:
Considering byte and uint2 images, the domain of color space values is expected to be spread to the full domain of [0..255] or [0..65535], respectively. This includes a shift in the case of signed values, such that the origin of signed values (e.g., CIELab) may not be at the center of the domain.
Hue values are represented by angles of [0..2PI[ and are coded for the particular image types differently:
byte-images map the angle domain on [0..255].
uint2/int4-images are coded in minutes of arc [0..21600[, except for the transformations 'cielchab' and 'cielchuv' for int4-images, where they are coded in seconds of arc [0..1296000[.
real-images are coded in radians [0..2PI[, except for the transformations 'cielchab' and 'cielchuv' , where the standards ISO 11664-4:2008 and ISO 11664-5:2009 require the hue to be specified in degrees.
Saturation values are represented by percentages of [0..100] and are coded for the particular image type differently:
byte-images map the saturation values to [0..255].
uint2/int4-images map the saturation values to [0..10000].
real-images map the saturation values to [0..1].
Supported are the transformations listed below. Note, all domains are based on RGB values scaled to [0; 1]. To obtain the domain of a certain image type, they must be scaled accordingly with the value range. Due to different precision the values obtained using the given equations may slightly differ from the values returned by the operator.
Note, this implies that , , and are not independent of each other.
Black point B: (, , ) = (0, 0, 0)
White point W (according to image type):
byte: (, , ) = (255, 255, 255)
uint2: (, , ) = (, , )
int4: (, , ) = (, , )
real: (, , ) = (1.0, 1.0, 1.0)
(Scaled to the maximum gray value in the case of byte and uint2. In the case of int4 L and a are scaled to the maximum gray value, b is scaled to the minimum gray value, such that the origin stays at 0.)
Black point B: (, , ) = (0, 0, 0)
White point W (according to image type):
byte: (, , ) = (255, 255, 255)
uint2: (, , ) = (, , )
int4: (, , ) = (, , )
real: (, , ) = (1.0, 1.0, 1.0)
(Scaled to the maximum gray value in the case of byte and uint2. In the case of int4, L and C are scaled to the maximum gray value, while h is given in seconds of arc.)
Black point B: (, , ) = (0, 0, 0)
White point W (according to image type):
byte: (, , ) = (255, 255, 255)
uint2: (, , ) = (, , )
int4: (, , ) = (, ,