version 2, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
pnmtotiffcmyk |
|
|
2 |
!!!pnmtotiffcmyk |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OPTIONS |
|
|
7 |
BUGS |
|
|
8 |
SEE ALSO |
|
|
9 |
AUTHOR |
|
|
10 |
---- |
|
|
11 |
!!NAME |
|
|
12 |
|
|
|
13 |
|
|
|
14 |
pnmtotiffcmyk - convert a a portable anymap into a CMYK encoded TIFF file |
|
|
15 |
!!SYNOPSIS |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
__pnmtotiffcmyk__ |
|
|
19 |
[[__Compargs__][[__Tiffargs__][[__Convargs__][[ |
|
|
20 |
''pnmfile'' ] |
|
|
21 |
|
|
|
22 |
|
|
|
23 |
Compargs: |
|
|
24 |
|
|
|
25 |
|
|
|
26 |
[[__-none__|__-packbits__|__-lzw__ |
|
|
27 |
[[__-predictor__ ''n'']] |
|
|
28 |
|
|
|
29 |
|
|
|
30 |
Tiffargs: |
|
|
31 |
|
|
|
32 |
|
|
|
33 |
[[__-msb2lsb__|__-lsb2msb__] [[__-rowsperstrip__ |
|
|
34 |
''n''] |
|
|
35 |
[[__-lowdotrange__ ''n''] [[__-highdotrange__ |
|
|
36 |
''n''] |
|
|
37 |
[[__-knormal__|__-konly__|__-kremove__] |
|
|
38 |
|
|
|
39 |
|
|
|
40 |
Convargs: |
|
|
41 |
|
|
|
42 |
|
|
|
43 |
[[[[__-default__][[__Defargs__]|__-negative__] |
|
|
44 |
|
|
|
45 |
|
|
|
46 |
Defargs: |
|
|
47 |
|
|
|
48 |
|
|
|
49 |
[[__-theta__ ''deg''] [[__-gamma__ ''n''] |
|
|
50 |
[[__-gammap__ ''-1''|__-gammap__ |
|
|
51 |
''n''] |
|
|
52 |
!!DESCRIPTION |
|
|
53 |
|
|
|
54 |
|
|
|
55 |
Reads a portable anymap as input. Produces a CMYK encoded |
|
|
56 |
TIFF file as output. Optionally modifies the colour balance |
|
|
57 |
and black level, and removes CMY from under K. |
|
|
58 |
!!OPTIONS |
|
|
59 |
|
|
|
60 |
|
|
|
61 |
The order of most options is not important, but options for |
|
|
62 |
particular conversion algorithms must appear after the |
|
|
63 |
algorithm is selected (__-default__,__-negative__). If |
|
|
64 |
no algorithm is selected then __-default__ is assumed and |
|
|
65 |
the appropriate options |
|
|
66 |
(__-theta__,__-gamma__,__-gammap__) can appear |
|
|
67 |
anywhere. |
|
|
68 |
|
|
|
69 |
|
|
|
70 |
__-none__,__-packbits__,__-lzw__,__-predictor__ |
|
|
71 |
|
|
|
72 |
|
|
|
73 |
Tiff files can be compressed. By default LZW decompression |
|
|
74 |
is used, but (apparently) some readers cannot read this, so |
|
|
75 |
you may want to select a different algorithm |
|
|
76 |
(__-none__,__-packbits__). For LZW compression, a |
|
|
77 |
__-predictor__ value of 2 forces horizontal differencing |
|
|
78 |
of scanlines before encoding; a value of 1 forces no |
|
|
79 |
differencing. |
|
|
80 |
|
|
|
81 |
|
|
|
82 |
__-msb2lsb__,__-lsb2msb__ |
|
|
83 |
|
|
|
84 |
|
|
|
85 |
These flags control fill order (default is |
|
|
86 |
__-msb2lsb__). |
|
|
87 |
|
|
|
88 |
|
|
|
89 |
__-rowsperstrip__ |
|
|
90 |
|
|
|
91 |
|
|
|
92 |
This sets the number of rows in an image strip (data in the |
|
|
93 |
Tiff files generated by this program is stored in strips - |
|
|
94 |
each strip is compressed individually). The default gives a |
|
|
95 |
strip size of no more than 8 kb. |
|
|
96 |
|
|
|
97 |
|
|
|
98 |
__-lowdotrange__,__-highdotrange__ |
|
|
99 |
|
|
|
100 |
|
|
|
101 |
These options set tag values that may be useful for |
|
|
102 |
printers. They have not been tested. |
|
|
103 |
|
|
|
104 |
|
|
|
105 |
__-knormal__,__-kremove__,__-konly__ |
|
|
106 |
|
|
|
107 |
|
|
|
108 |
These options modify the values written to the Tiff file |
|
|
109 |
after the conversion calculations (described below) are |
|
|
110 |
completed. They are useful only for testing and debugging |
|
|
111 |
the code. |
|
|
112 |
|
|
|
113 |
|
|
|
114 |
__-kremove__ sets the black (K) layer to zero while |
|
|
115 |
__-konly__ sets all inks to the black value. |
|
|
116 |
|
|
|
117 |
|
|
|
118 |
__-default__,__-negative__ |
|
|
119 |
|
|
|
120 |
|
|
|
121 |
__-negative__ selects a simple algorithm that generates a |
|
|
122 |
colour negative. None of the following options apply to this |
|
|
123 |
algorithm, which is included as an example in the source to |
|
|
124 |
help implementors of other conversions. __-default__ is |
|
|
125 |
not needed, unless it is used to countermand a |
|
|
126 |
__-negative__ on the same command line. The default |
|
|
127 |
conversion from RGB to CMYK can be modified by altering the |
|
|
128 |
options listed below. |
|
|
129 |
|
|
|
130 |
|
|
|
131 |
The CMYKTiff web site includes tests on the conversion |
|
|
132 |
parameters. The test images illustrate the command line |
|
|
133 |
options in practice and may make the following explanation |
|
|
134 |
clearer. |
|
|
135 |
|
|
|
136 |
|
|
|
137 |
__-theta__ ''deg'' |
|
|
138 |
|
|
|
139 |
|
|
|
140 |
The basic conversion from RGB to CMY uses C = 1-R, M = 1-G, |
|
|
141 |
Y = 1-B. __-theta__ provides a simple correction for any |
|
|
142 |
colour bias that may occur in the printed image because, in |
|
|
143 |
practice, inks do not exactly complement the primary |
|
|
144 |
colours. It rotates the colours by the amount given |
|
|
145 |
(''deg'') in degrees. Unless you are trying to produce |
|
|
146 |
unusual effects you will need to use small values (try |
|
|
147 |
generating three images at -10, 0 (the default) and 10 |
|
|
148 |
degrees and seeing which has the best colour |
|
|
149 |
balance. |
|
|
150 |
|
|
|
151 |
|
|
|
152 |
__-gamma__ ''n'' |
|
|
153 |
|
|
|
154 |
|
|
|
155 |
The black (K) component of the image is calculated as |
|
|
156 |
min(C,Y,M). __-gamma__ applies a gamma correction to this |
|
|
157 |
level. In other words, the final black level is K |
|
|
158 |
(normalised to the range 0 to 1) raised to the ''n''th |
|
|
159 |
power. In practice this means that a value greater than 1 |
|
|
160 |
makes the image lighter and a value less than 1 makes the |
|
|
161 |
image darker. The range of allowed values is 0.1 to |
|
|
162 |
10. |
|
|
163 |
|
|
|
164 |
|
|
|
165 |
__-gammap__ ''n'' |
|
|
166 |
|
|
|
167 |
|
|
|
168 |
This option controls the removal of CMY under K. If ''n'' |
|
|
169 |
is -1 then no removal occurs and C, M, Y and K are |
|
|
170 |
calculated as above. This means that, when printed, dark |
|
|
171 |
areas contain all four inks, which can make high contrast |
|
|
172 |
areas, like lettering, appear fuzzy. |
|
|
173 |
|
|
|
174 |
|
|
|
175 |
By default, when __-gammap__ is not given on the command |
|
|
176 |
line, the colours are reduced in dark areas by subtracting |
|
|
177 |
the black level. The value subtracted is calculated with the |
|
|
178 |
same gamma correction given by __-gamma__. Hopefully this |
|
|
179 |
will reduce fuzziness without changing the appearance of the |
|
|
180 |
image significantly. |
|
|
181 |
|
|
|
182 |
|
|
|
183 |
If __-gammap__ ''n'' is given, with n between 0.01 and |
|
|
184 |
10, then black is still subtracted, but the subtracted value |
|
|
185 |
is calculated using ''n'' rather than any value supplied |
|
|
186 |
with __-gamma__. For example, it may be best to only |
|
|
187 |
subtract black from the coloured inks in the very darkest |
|
|
188 |
regions. In that case, ''n'' should be a large value, |
|
|
189 |
such as 5. |
|
|
190 |
!!BUGS |
|
|
191 |
|
|
|
192 |
|
|
|
193 |
This program is not self-contained. It must be used with |
2 |
perry |
194 |
!NetPbm and libtiff must be available (libtiff is included in |
|
|
195 |
the 1mar94 release of !NetPbm). |
1 |
perry |
196 |
!!SEE ALSO |
|
|
197 |
|
|
|
198 |
|
|
|
199 |
pnmtotiff(1), tifftopnm(1), pnm(5) |
|
|
200 |
!!AUTHOR |
|
|
201 |
|
|
|
202 |
|
|
|
203 |
Copyright (c) 1999 Andrew Cooke (Jara Software). Released |
|
|
204 |
under the GPL with no warranty. See source or COPYRIGHT and |
|
|
205 |
LICENCE files in distribution for full details. |
|
|
206 |
|
|
|
207 |
|
|
|
208 |
Much of the code (and man page!) uses ideas from other pnm |
|
|
209 |
programs, written by Jef Poskanzer (thanks go to him and |
|
|
210 |
libtiff maintainer Sam Leffler). A small section of the code |
|
|
211 |
- some of the tiff tag settings - is derived directly from |
|
|
212 |
pnmtotiff, by Jef Poskanzer, which, in turn, acknowledges |
|
|
213 |
Patrick Naughton with the following text: |
|
|
214 |
|
|
|
215 |
|
|
|
216 |
Derived by Jef Poskanzer from ras2tif.c, which |
|
|
217 |
is: |
|
|
218 |
|
|
|
219 |
|
|
|
220 |
Copyright (c) 1990 by Sun Microsystems, Inc. |
|
|
221 |
|
|
|
222 |
|
|
|
223 |
Author: Patrick J. Naughton |
|
|
224 |
naughton@wind.sun.com |
|
|
225 |
|
|
|
226 |
|
|
|
227 |
Permission to use, copy, modify, and distribute this |
|
|
228 |
software and its documentation for any purpose and without |
|
|
229 |
fee is hereby granted, provided that the above copyright |
|
|
230 |
notice appear in all copies and that both that copyright |
|
|
231 |
notice and this permission notice appear in supporting |
|
|
232 |
documentation. |
|
|
233 |
|
|
|
234 |
|
|
|
235 |
This file is provided AS IS with no warranties of any kind. |
|
|
236 |
The author shall have no liability with respect to the |
|
|
237 |
infringement of copyrights, trade secrets or any patents by |
|
|
238 |
this file or any part thereof. In no event will the author |
|
|
239 |
be liable for any lost revenue or profits or other special, |
|
|
240 |
indirect and consequential damages. |
|
|
241 |
---- |