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
|
\
.\" This man page was generated by the Netpbm tool 'makeman' from HTML source.
.\" Do not hand-hack it! If you have bug fixes or improvements, please find
.\" the corresponding HTML page on the Netpbm website, generate a patch
.\" against that, and send it to the Netpbm maintainer.
.TH "Ppmtopcx User Manual" 1 "26 September 2020" "netpbm documentation"
.SH NAME
ppmtopcx - convert a PPM image to a PCX file
.UN synopsis
.SH SYNOPSIS
\fBppmtopcx\fP
[\fB-24bit\fP]
[\fB-8bit\fP]
[\fB-packed\fP]
[\fB-stdpalette\fP]
[\fB-palette=\fP\fIpalettefile\fP]
[\fB-planes=\fP\fIplanes\fP]
[\fB-xpos=\fP\fIcols\fP]
[\fB-ypos=\fP\fIrows\fP]
[\fIppmfile\fP]
.UN description
.SH DESCRIPTION
.PP
This program is part of
.BR "Netpbm" (1)\c
\&.
.PP
\fBppmtopcx\fP reads a PPM image as input and produces a PCX file
as output. The type of the PCX file depends on the number of colors
in the input image:
.TP
16 colors or fewer:
1 bit/pixel, 1-4 planes, colormap in header
.TP
more than 16 colors, but no more than 256:
8 bits/pixel, 1 plane, colormap at the end of the file.
.TP
More than 256 colors:
24bit truecolor file (8 bits/pixel, 3 planes).
.PP
You can override some of that and explicitly choose the format with
the options below.
.UN options
.SH OPTIONS
.PP
In addition to the options common to all programs based on libnetpbm
(most notably \fB-quiet\fP, see
.UR index.html#commonoptions
Common Options
.UE
\&), \fBppmtopcx\fP recognizes the following
command line options:
.TP
\fB-24bit\fP
Produce a 24bit truecolor PCX file, even if the image has 256
colors or fewer.
.TP
\fB-8bit\fP
Produce an 8bit (256 colors) PCX file, even if the image has 16
colors or fewer.
.sp
This option was added in Netpbm 10.18 (August 2003).
.TP
\fB-packed\fP
Use "packed pixel" format for files with 16 colors or
fewer: 1, 2, or 4 bits/pixel, 1 plane.
.TP
\fB-stdpalette\fP
Instead of computing a palette from the colors in the image, use
a standard, built-in 16 color palette. If the image contains a color
that is not in the standard palette, \fBppmtopcx\fP fails.
.sp
The standard palette is not only a set of colors, but a specific
mapping of palette indexes to colors. E.g. red is 4.
.sp
You can use \fBpnmremap\fP with a suitable PPM image of the standard
palette to adapt your image to use exactly those colors in the palette
so that \fBppmtopcx -stdpalette\fP will work on it.
.sp
The file \fBpcxstd.ppm\fP, part of Netpbm, contains the standard
palette.
.sp
Although the PCX header tells exactly what palette is used in the
file, some older PCX interpreters do not use that information. They
instead assume the standard palette. If you don't use the
\fB-stdpalette\fP option, \fBppmtopcx\fP, \fBppmtopcx\fP may create
an image that uses a different palette (a rearrangement of the same
colors) and then one of these older interpreters would interpret the
colors in the image wrong.
.sp
You cannot specify this option along with \fB-palette\fP.
.sp
This option was new in Netpbm 10.22 (April 2004).
.TP
\fB-palette=\fP\fIpalettefile\fP
Instead of computing the palette from the colors in the image, use
the palette from the file \fIpalettefile\fP. If the palette contains
a color that is not in that palette, \fBppmtopcx\fP fails.
.sp
The palette file must be a PPM image that contains one pixel for
each color in the palette. It doesn't matter what the aspect ratio
of the palette image is. The order of the colors in the PCX palette
is the order of the pixels in the PPM image in standard western
reading order (left to right, top to bottom). If there is a duplicate
color in the palette, \fBppmtopcx\fP chooses between them arbitrarily
in building the PCX raster.
.sp
You would need this only if you have a PCX reader that can't read
the palette that is in the PCX file and instead assumes some particular
palette. See also the \fB-stdpalette\fP option.
.sp
If your input image might contain colors other than those in your
palette, you can convert the input image to one that contains only
those colors in your palette with \fBpnmremap\fP.
.sp
You cannot specify this along with \fB-stdpalette\fP.
.sp
This option was new in Netpbhm 10.25 (October 2004).
.TP
\fB-planes=\fP\fIplanes\fP
Generate a PCX file with \fIplanes\fP planes, even though the number
of colors in the image could be represented in fewer. This makes the file
larger, but some PCX interpreters are capable of processing only certain
numbers of planes.
.sp
This is meaningful only when \fBppmtopcx\fP generates an image in
the 16 color palette format without packed pixels. Consequently, you
cannot specify this option together with \fB-24bit\fP or
\fB-8bit\fP or \fB-packed\fP.
.sp
The valid values for \fIplanes\fP are 1, 2, 3, and 4. By default,
\fBppmtopcx\fP chooses the smallest number of planes that can represent
the colors in the image. E.g. if there are 5 colors, \fBppmtopcx\fP
chooses 3 planes.
.sp
This option was new in Netpbm 10.21 (March 2004).
.TP
\fB-xpos=\fP\fIcols\fP
.TP
\fB-ypos=\fP\fIrows\fP
These options set the position of the image in some field
(e.g. on a screen) in columns to the right of the left edge and rows
below the top edge. The PCX format contains image position
information. Don't confuse this with the position of an area of
interest within the image. For example, using \fBpnmpad\fP to add a
10 pixel left border to an image and then converting that image to PCX
with xpos = 0 is not the same as converting the original image to PCX
and setting xpos = 10.
.sp
The values may be from -32767 to 32768.
.sp
The default for each is zero.
.UN seealso
.SH SEE ALSO
.BR "pcxtoppm" (1)\c
\&,
.BR "ppm" (1)\c
\&
.UN authors
.SH AUTHORS
Copyright (C) 1994 by Ingo Wilken (\fIIngo.Wilken@informatik.uni-oldenburg.de\fP)
.PP
Based on previous work by Michael Davidson.
.SH DOCUMENT SOURCE
This manual page was generated by the Netpbm tool 'makeman' from HTML
source. The master documentation is at
.IP
.B http://netpbm.sourceforge.net/doc/ppmtopcx.html
.PP
|