summary refs log tree commit diff
path: root/pnmtotiffcmyk.html
blob: cc5dc34fedafe6cdd6617727e8d214043e697f1e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN">
<html><head><title>Pnmtotiffcmyk User Manual</title></head>
<body>
<h1>pnmtotiffcmyk</h1>
Updated: 21 March 2017
<br>
<a href="#index">Table Of Contents</a>

<h2>NAME</h2>

pnmtotiffcmyk - convert a Netpbm image into a CMYK encoded TIFF file

<h2 id="synopsis">SYNOPSIS</h2>

<b>pnmtotiffcmyk </b>
	[<b>-none</b>|<b>-packbits</b>|<b>-lzw</b>]
	[<b>-predictor</b> <i>n</i>]
	[<b>-msb2lsb</b>|<b>-lsb2msb</b>]
	[<b>-rowsperstrip</b> <i>n</i>]
	[<b>-lowdotrange</b> <i>n</i>]
	[<b>-highdotrange</b> <i>n</i>]
	[<b>-knormal</b>|<b>-konly</b>|<b>-kremove</b>]
	[[<b>-default</b>]
        [<b>-theta</b> <i>deg</i>]
        [<b>-gamma</b> <i>n</i>]
        [<b>-gammap</b> <i>n</i>]
        [<b>-negative</b>]

<h2 id="description">DESCRIPTION</h2>

<p>This program is part of <a href="index.html">Netpbm</a>.

<p><b>pnmtotiffcmyk</b>reads a PNM image as input and produces a CMYK
encoded TIFF file as output.  It optionally modifies the color
balance and black level, and modifies removal of CMY from under K.

<p>Output is to Standard Output, but unlike with most Netpbm programs,
Standard Output must be a seekable file.  An ordinary file is fine, but you
cannot pipe the output to another program.  Furthermore, the program replaces
any content currently in the file even if it was opened for appending.

<p><b>pamtotiff</b> generates many other kinds of TIFF files.


<h2 id="options">OPTIONS</h2>


<p>In addition to the options common to all programs based on libnetpbm
(most notably <b>-quiet</b>, see <a href="index.html#commonoptions">
Common Options</a>), <b>pnmtotiffcmyk</b> recognizes the following
command line options:

<p>The order of most options is not important, but options for particular
conversion algorithms must appear after the algorithm is selected
(<b>-default</b>,<b>-negative</b>).  If you don't select an algorithm,
<b>pnmtotiffcmyk</b> assumes <b>-default</b> and the appropriate
options (<b>-theta</b>,<b>-gamma</b>,<b>-gammap</b>) can appear
anywhere.

<h3><b>-none</b>,<b>-packbits</b>,<b>-lzw</b>,<b>-predictor</b></h3>

<p>Tiff files can be compressed.  By default, <b>pnmtotiffcmyk</b>
uses LZW decompression, but (apparently) some readers cannot read
this, so you may want to select a different algorithm
(<b>-none</b>,<b>-packbits</b>).  For LZW compression, a
<b>-predictor</b> value of 2 forces horizontal differencing of
scanlines before encoding; a value of 1 forces no differencing.

<h3><b>-msb2lsb</b>,<b>-lsb2msb</b></h3>

<p>These options control fill order (default is <b>-msb2lsb</b>).

<h3><b>-rowsperstrip</b></h3>

<p>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.

<h3><b>-lowdotrange</b>,<b>-highdotrange</b></h3>

<p>These options set tag values that may be useful for printers.

<h3><b>-knormal</b>,<b>-kremove</b>,<b>-konly</b></h3>

<p>These options control the calculation of the CMYK ink levels.
They are useful only for testing and debugging the code.

<p><b>-kremove</b> sets the black (K) levels to zero while leaving the
other ink levels as they would be if the black level were normal.

<p><b>-konly</b> sets all inks to the normal black value.

<h3><b>-default</b>,<b>-negative</b></h3>

<p>These options control what ink levels <b>pnmtotiffcmyk</b> uses to
represent each input color.

<p><b>-negative</b> selects a simple algorithm that generates a color
negative.  None of the following options apply to this algorithm.  The
algorithm is included as an example in the source code to help
implementors of other conversions.

<p><b>-default</b> is not necessary, unless you have to countermand a
<b>-negative</b> on the same command line.  

<p>The default conversion from RGB to CMYK is as follows: The basic
values of the 3 pigments are C = 1-R, M = 1-G, Y = 1-B.  From this,
<b>pnmtotiffcmyk</b> chooses a black (K) level which is the minimum of
those three.  It then replaces that much of the 3 pigments with the
black.  I.e. it subtracts K from each of the basic C, M, and Y
values.

<p>The options below modify this conversion.

<h3><b>-theta</b> <i>deg</i></h3>

<p><b>-theta</b> provides a simple correction for any color bias that
may occur in the printed image because, in practice, inks do not
exactly complement the primary colors.  It rotates the colors (before
black replacement) by <i>deg</i> degrees in the color wheel.  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 see which has the best color balance.

<h3><b>-gamma</b> <i>n</i></h3>

<p><b>-gamma</b> applies a gamma correction to the black (K) value
described above.  Specifically, instead of calculating the K value as
min(C,M,Y), <b>pnmtotiffcmyk</b> raises that value (normalised to the
range 0 to 1) to the <i>n</i>th 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.

<h3><b>-gammap</b> <i>n</i></h3>

<p>This option controls the black replacement.

<p>If you specify <b>-gammap</b>, <b>pnmtotiffcmyk</b> uses the specified
gamma value in computing how much ink to remove from the 3 pigments, but
still uses the regular gamma value (<b>-gamma</b> option) to generate the
actual amount of black ink with which to replace it.

<p>Values of <i>n</i> from 0.01 to 10 are valid.

<p>For example, it may be best to only subtract black from the
colored inks in the very darkest regions.  In that case, <i>n</i>
should be a large value, such as 5.

<p>As a special case, if <i>n</i> is -1, <b>pnmtotiffcmyk</b> does not
remove any pigment (but still adds the black ink).  This means dark
areas are even darker.  Furthermore, when printed, dark areas contain
a lot of ink which can make high contrast areas, like lettering,
appear fuzzy.  It's hard to see what the utility of this is.

<h2 id="seealso">SEE ALSO</h2>

<a href="pamtotiff.html">pamtotiff</a>, 
<a href="tifftopnm.html">tifftopnm</a>, 
<a href="pnm.html">pnm</a>

<h2 id="author">AUTHOR</h2>

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 uses ideas from other Netpbm 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:

<blockquote>
<p>Derived by Jef Poskanzer from ras2tif.c, which is:

<p>Copyright (c) 1990 by Sun Microsystems, Inc.

<p>Author: Patrick J. Naughton
<a href="mailto:naughton@wind.sun.com">naughton@wind.sun.com</a>

<p>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
supporting documentation.

<p>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.

</blockquote>

<hr>
<h2 id="index">Table Of Contents</h2>
<ul>
<li><a href="#synopsis">SYNOPSIS</a>
<li><a href="#description">DESCRIPTION</a>
<li><a href="#options">OPTIONS</a>
<li><a href="#seealso">SEE ALSO</a>
<li><a href="#author">AUTHOR</a>
</ul>
</body>
</html>