pnmtotiffcmyk - convert a portable anymap into a CMYK encoded TIFF file
Reads a portable anymap as input.
Produces a CMYK encoded TIFF file as output.
Optionally modifies the colour balance and black level, and removes CMY
from under K.
The order of most options is not important, but options for particular
conversion algorithms must appear after the algorithm is selected
If no algorithm is selected then
is assumed and the appropriate options
can appear anywhere.
Tiff files can be compressed. By default LZW decompression is used, but
(apparently) some readers cannot read this, so you may want to select a
For LZW compression, a
value of 2 forces horizontal differencing of scanlines before encoding; a
value of 1 forces no differencing.
These flags control fill order (default is
This sets the number of rows in an image strip (data in the Tiff files
generated by this program is stored in strips - each strip is
compressed individually). The default gives a strip size of no more
than 8 kb.
These options set tag values that may be useful for printers. They
have not been tested.
These options modify the values written to the Tiff file after the
conversion calculations (described below) are completed. They are
useful only for testing and debugging the code.
sets the black (K) layer to zero while
sets all inks to the black value.
selects a simple algorithm that generates a colour negative. None of
the following options apply to this algorithm, which is included as an
example in the source to help implementors of other conversions.
is not needed, unless it is used to countermand a
on the same command line. The default conversion from RGB to CMYK can
be modified by altering the options listed below.
The CMYKTiff web site includes tests on the conversion parameters.
The test images illustrate the command line options in practice and
may make the following explanation clearer.
- -theta deg
The basic conversion from RGB to CMY uses C = 1-R, M = 1-G, Y = 1-B.
provides a simple correction for any colour bias that may occur in the
printed image because, in practice, inks do not exactly complement the
primary colours. It rotates the colours by the amount given
in degrees. Unless you are trying to produce unusual effects you will
need to use small values (try generating three images at -10, 0 (the
default) and 10 degrees and seeing which has the best colour balance.
- -gamma n
The black (K) component of the image is calculated as min(C,Y,M).
applies a gamma correction to this level. In other words, the final
black level is K (normalised to the range 0 to 1) raised to the
power. In practice this means that a value greater than 1 makes the
image lighter and a value less than 1 makes the image darker. The
range of allowed values is 0.1 to 10.
- -gammap n
This option controls the removal of CMY under K. If
is -1 then no removal occurs and C, M, Y and K are calculated as
above. This means that, when printed, dark areas contain all four
inks, which can make high contrast areas, like lettering, appear
By default, when
is not given on the command line, the colours are reduced in dark
areas by subtracting the black level. The value subtracted is
calculated with the same gamma correction given by
Hopefully this will reduce fuzziness without changing the appearance
of the image significantly.
is given, with n between 0.01 and 10, then black is still subtracted,
but the subtracted value is calculated using
rather than any value supplied with
For example, it may be best to only subtract black from the coloured
inks in the very darkest regions. In that case,
should be a large value, such as 5.
This program is not self-contained. It must be used with NetPbm and
libtiff must be available (libtiff is included in the 1mar94 release
Copyright (c) 1999 Andrew Cooke (Jara Software). Released under the
GPL with no warranty. See source or COPYRIGHT and LICENCE files in
distribution for full details.
Much of the code (and man page!) uses ideas from other pnm programs,
written by Jef Poskanzer (thanks go to him and libtiff maintainer Sam
Leffler). A small section of the code - some of the tiff tag settings
- is derived directly from pnmtotiff, by Jef Poskanzer, which, in
turn, acknowledges Patrick Naughton with the following text:
Derived by Jef Poskanzer from ras2tif.c, which is:
Copyright (c) 1990 by Sun Microsystems, Inc.
Author: Patrick J. Naughton
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
This file is provided AS IS with no warranties of any kind. The author
shall have no liability with respect to the infringement of copyrights,
trade secrets or any patents by this file or any part thereof. In no
event will the author be liable for any lost revenue or profits or
other special, indirect and consequential damages.