See figure 2.5.
The colour functions can be divided into two main types. First, functions to
transform images between the different colour spaces supported by VIPS:
RGB
(also referred to as disp
), sRGB
, XYZ
,
Yxy
, Lab
, LabQ
, LabS
, LCh
and
UCS
), and second, functions for calculating colour difference
metrics. Figure 2.4 shows how the VIPS colour spaces
interconvert.
The colour spaces supported by VIPS are:
im_LabQ2Lab()
for an explanation. You cannot perform
calculations on LabQ
images. They are for storage only. Also refered
to as LABPACK
.
IM_BANDFMT_SHORT
image, scaled to fit the full range of bits. It is
the best format for computation, being relatively compact, quick, and
accurate. Colour values expressed in this way are hard to visualise.
Lab
colourspace represents CIE
IM_BANDFMT_FLOAT
image. This is the simplest format for general work: adding the
constant 50 to the L channel, for example, has the expected result.
IM_BANDFMT_FLOAT
image.
IM_BANDFMT_FLOAT
image.
disp
) This format is similar to the RGB colour
systems used in other packages. If you want to export your image to a PC,
for example, convert your colorimetric image to RGB
, then turn it
to TIFF with im_vips2tiff()
. You need to supply a structure which
characterises your display. See the manual page for im_col_XYZ2rgb()
for hints on these guys.
VIPS also supports sRGB
. This is a version of RGB with a carefully
defined and standard conversion from XYZ. See:
http://www.color.org/
Lab
, but rectangular
UCS
are extremely slow.
All VIPS colourspaces assume a D65 illuminant.
The colour-difference functions calculate either CIE
(1976
or 2000) or
CMC(1:1) on two images in
Lab
, XYZ
or disp
colour space.