DIPlib Documentation - ©1995-2017 Quantitative Imaging Group, Delft University of Technology.

ImageReadColour

Read colour image from file (in dipIO)

SYNOPSIS

dip_Error dipio_ImageReadColour ( image, filename, photometric, format, addExtensions, recognised )

FUNCTION

This function reads an image from a file and puts it in image. image must be allocated before calling this function. It works the same as ImageRead, except that, if the file contains a colour image, Colour2Gray is not called. The returned image has an extra dimension with colours (always the last dimension), and photometric is set to the colour space.

ARGUMENTS

Data typeNameDescription
dip_ImageimageOutput image
dip_StringfilenameFile name
dipio_PhotometricInterpretation*photometricPhotometric interpretation (==colour space)
dip_intformatID of file format
dip_BooleanaddExtensionsAdd file format extensions to filename
dip_Boolean *recognisedPointer to boolean containing the file read status

The enumerator dipio_PhotometricInterpretation contains the following constants:

NameDescription
DIPIO_PHM_GREYVALUENo colour information present; it's a grey-value image.
DIPIO_PHM_RGBRGB image (the first three planes are red, green and blue)
DIPIO_PHM_RGB_NONLINEARNon-linear R'G'B' image (RGB channels to the power of 0.4)
DIPIO_PHM_CMYCMY image (the first three planes are cyan, magenta and yellow)
DIPIO_PHM_CMYKCMYK image (the first four planes are cyan, magenta, yellow and black)
DIPIO_PHM_CIELUVCIE L*u'v' image (the first three planes are luminosity, u* and v*)
DIPIO_PHM_CIELABCIE L*a*b* image (the first three planes are luminosity, a* and b*)
DIPIO_PHM_CIEXYZCIE XYZ (the first three planes are X, Y and Z)
DIPIO_PHM_CIEYXYCIE Yxy (the first three planes are Y, x and y)
DIPIO_PHM_HCVHCV image (the first three planes are hue, chroma and value)
DIPIO_PHM_HSVHSV image (the first three planes are hue, saturation and value)
DIPIO_PHM_DEFAULTSame as DIPIO_PHM_GREYVALUE
DIPIO_PHM_GENERICAnything can be coded in the channels; the same as DIPIO_PHM_CMYK

Most file formats support only some of these.

SEE ALSO

ImageRead, ImageReadROI, ImageFileGetInfo, ImageReadCSV, ImageReadGIF, ImageReadICS, ImageReadJPEG, ImageReadLSM, ImageReadPIC, ImageReadPNG, ImageReadTIFF, ImageWrite, Colour2Gray