Hi,
Here is a commandline tool which does the same as icc-trans. The difference is that this tool reads all color values from the command line instead of stdin (it doesn't use stdin at all). This makes it easier to use in a system() call. The output in non-verbose mode is made so it is easy to parse using a regexp or by splitting the line at every space.
For example:
icc-translate 0 3 0 sRGB.icc EuroscaleCoated.icc 0 - 0 0 0 0.5 0.5 0.5 1 1 1
returns the output:
## C=93.04 M=83.21 Y=74.29 K=90.05 ##
## C=58.41 M=40.18 Y=31.25 K=3.68 ##
## C=6.01 M=0.00 Y=0.00 K=0.00 ##
Usage: icc-translate
<bool> verbose (0 for false, 1 for true)
<int> intent: 0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute
<bool> black/white compensation
<path> input profile
<path> output profile
<int> proofing intent
<path> proofing profile, '-' for none
<double> color values, floating point from 0 to 1
I know it would be much nicer to use gnu.getopt, but the tool was not meant for normal interactive use, and I did not want to rely on all installations having getopt.
I've retained the normal lcms copyright at the top. Matti is free to include it.
icc-translate.c
Description: Binary data
---- - Peter Speck
