## imdi/cctiff

### Summary

Color convert a TIFF file using a sequence of compatible ICC device profiles, abstract profiles, device link profiles and calibration files. The sequence may be zero length, facilitating format conversion and ICC profile embedding without otherwise altering the pixel values.

### Usage

cctiff [-options] { [-i intent] profile.icm | [-d dir] calibration.cal ...} infile.tif outfile.tif
-v Verbose
-c Combine linearisation curves into one transform
-p Use slow precise floating point conversion, rather than fast integer routines.
-k Check fast result against precise, and report differences.
-r n Override the default CLUT resolution
-t n Choose TIFF output encoding from 1..n
-a Read and Write planes > 4 as alpha planes
-I Ignore any file or profile colorspace mismatches
-D Don't append or set the output TIFF description
-e profile.[icm | tiff] Optionally embed a profile in the destination TIFF file.
This may be an ICC file or a TIFF file with embedded profile.
Then for each profile in the linked sequence:
-i intent Profile intent
p = perceptual, r = relative colorimetric,
s = saturation, a = absolute colorimetric
-o order n = normal (priority: lut > matrix > monochrome)
r = reverse (priority: monochrome > matrix > lut)
profile.[icm | tiff] A Device, Link or Abstract profile. This may be an ICC file
(May be embedded profile in TIFF file)
or each calibration file in sequence:
-d dir Calibration direction
f = forward cal. (default), b = backwards cal.
calibration.cal A calibration file.
Then finally:
infile.tif A TIFF Raster file that will be the input raster to be transformed.
outfile.tif A TIFF Raster file created from the input raster, using the given color transform.
Examples
Convert an RGB file to a CMYK file using perceptual intent:
cctiff -ip sRGB.icm -i cmyk.icm rgbinfile.tif cmykoutfile.tif
Same as above, but use the source file embedded profile, and embed the resulting colorspace profile in the output:
cctiff -e cmyk.icm -ip rgbfile.tif -ip cmyk.icm rgbinfile.tif cmyout.tif
Convert a raster file using a device link:
cctiff devicelink.icm infile.tif outfile.tif
Convert an RGB source to CMYK via an abstract adjustment, and then convert the CMYK to CMYK using a device link, also apply CMYK calibration:
cctiff -ir sRGB.icm abstract.icm -ir CMYK.icm devlink.icm CMYKcal.cal infile.tif outfile.tif
Convert an RGB source file into a CIELab raster file:
cctiff -t1 -ir sRGB.icm rgbfile.tif labfile.tif

### Comments

The -v flag reports extra information about the ICC profile.
The -c, -p, -k and -r options are intended to aid debugging.
Some colorspaces can be encoded in more than one way. If there is a choice, the choice should be specified the -e parameter. If the parameter is needed, then cctiff will issue an error that describes the possible choices (ie. TIFF LAB encoding). For instance, for an LAB output there are usually two choices, 1 for CIELab encoding, and 2 for ICCLab encoding.
Normally colorspaces that have more than 4 channels will be read and written as multichannel TIFF files. These are not handled well by all applications, so the -a option causes extra channels above 4 to be stored as alpha planes, providing more flexibility in using such files.
The -I flag causes any mismatch between the color spaces of the image files and each profile in the sequence to be ignored. The results might be unpredictable unless you know exactly what you are doing.
The -D flag stops the description tag being set or appended to by cctiff.
The -e profile.[icm | tiff] option allows an ICC profile to be embedded in the destination TIFF file. The profile may either be an ICC file or a TIFF file with embedded profile.
Following these global options, you should specify the chain of profiles and calibrations you want to apply. Each link of the chain consists of the (optional) intent to be used for device profiles and the filename of the profile, or the optional direction to be used for the calibration and the filename of the calibration. The first profile or calibrations input colorspace must be compatible with the input TIFF file, and each profile or calibration output space must be compatible with the next profile or calibrations input space. An error will result if this is not the case.
The -i parameters selects the intent for the following device profile. Normally the same intent should be used for all device profiles, but other combinations allow special uses such as mixed proofing workflows.
The -o parameter changes the order the profiles tags are searched in. A profile is allowed to contain more than the minimum number of elements or table needed to describe a certain transform, and may contain redundant descriptions. By default, lut based table information will be used first if present, followed by matrix/shaper information, and only using monochrome information if it is all that is present. -o r reverses this order.
The file that will be the source of the ICC profile. This can be either an ICC profile or a TIFF file that contains an embedded profile. Typically the first profile in the chain might be taken from an embedded profile from the source TIFF file.
The -d parameters selects the direction for the following calibration. The default direction is the normal forward calibration, but if -db is used, then a bacwards (inverse) calibration will be applied.
The file that will be the source calibration. This will be an Argyll .cal format file.
The second last argument should be the name of the source TIFF file that is to be processed.
The last argument should be the name of the destination TIFF file to hold the results.
cctiff uses very fast integer conversion routines to process the raster. Both 8 and 16 bit per component files can be handled, and up to 8 color channels (The limit can be lifted to 15 without any trouble).