Write colour image to file (in dipIO)
dip_Error dipio_ImageWriteColour ( image, filename, photometric, physDims, format, compression )
This function writes a colour image to a file, overwriting any other file with the same name. photometric must be set to the correct value. Not all file formats support all photometric values, and some don't support colour at all. physDims gives physical dimensions of the image, and can be set to 0 for default values. Not all file formats are able to store physical dimensions. Get the format ID through the registry functions. See File formats recognized by dipIO for a list of currently supported formats. If format is 0, ICSv2 is used.
Data type | Name | Description |
dip_Image | image | Output image |
dip_String | filename | File name |
dipio_PhotometricInterpretation | photometric | Photometric interpretation (==colour space) |
dip_PhysicalDimensions | physDims | Physical dimensions structure. See PhysicalDimensionsNew |
dip_int | format | ID of file format |
dipio_Compression | compression | Compression method and level. See Compression methods for image files |
The enumerator dipio_PhotometricInterpretation contains the following constants:
Name | Description |
DIPIO_PHM_GREYVALUE | No colour information present; it's a grey-value image. |
DIPIO_PHM_RGB | RGB image (the first three planes are red, green and blue) |
DIPIO_PHM_RGB_NONLINEAR | Non-linear R'G'B' image (RGB channels to the power of 0.4) |
DIPIO_PHM_CMY | CMY image (the first three planes are cyan, magenta and yellow) |
DIPIO_PHM_CMYK | CMYK image (the first four planes are cyan, magenta, yellow and black) |
DIPIO_PHM_CIELUV | CIE L*u'v' image (the first three planes are luminosity, u* and v*) |
DIPIO_PHM_CIELAB | CIE L*a*b* image (the first three planes are luminosity, a* and b*) |
DIPIO_PHM_CIEXYZ | CIE XYZ (the first three planes are X, Y and Z) |
DIPIO_PHM_CIEYXY | CIE Yxy (the first three planes are Y, x and y) |
DIPIO_PHM_HCV | HCV image (the first three planes are hue, chroma and value) |
DIPIO_PHM_HSV | HSV image (the first three planes are hue, saturation and value) |
DIPIO_PHM_DEFAULT | Same as DIPIO_PHM_GREYVALUE |
DIPIO_PHM_GENERIC | Anything can be coded in the channels; the same as DIPIO_PHM_CMYK |
Most file formats support only some of these.
ImageWrite, ImageWriteCSV, ImageWriteEPS, ImageWriteFLD, ImageWriteGIF, ImageWriteICS, ImageWriteJPEG, ImageWritePNG, ImageWritePS, ImageWriteTIFF, ImageRead, Colour2Gray