1Ppmtoxpm User Manual(0) Ppmtoxpm User Manual(0)
2
3
4
6 ppmtoxpm - convert a PPM image to an X11 pixmap
7
8
10 ppmtoxpm [-name=xpmname] [-hexonly] [-rgb=rgb-textfile]
11 [-alphamask=pgmfile] [ppmfile]
12
13 Minimum unique abbreviation of option is acceptable. You may use dou‐
14 ble hyphens instead of single hyphen to denote options. You may use
15 white space in place of the equals sign to separate an option name from
16 its value.
17
18
20 This program is part of Netpbm(1).
21
22 ppmtoxpm reads a PPM image as input and produces X11 pixmap (version 3)
23 as output. This format can be loaded by the XPM library.
24
25 In the XPM output, colors may be identified by name, such as "Red", or
26 in hexadecimal, for example "#FF0000". In the hexadecimal format,
27 there may be from 1 through 4 hexadecimal digits per RGB component.
28
29 By default, ppmtoxpbm tries to find a name for each color in the image
30 in the system color dictionary ⟨libppm.html#rgb.txt⟩ , and if it finds
31 one, uses it. If it doesn't it uses hexadecimal. You can force ppm‐
32 toxpbm to use hexadecimal only with the -hexonly option. You can spec‐
33 ify a different color dictionary with the -rgb option.
34
35 When ppmtoxpm uses the hexadecimal format for identifying a color, it
36 uses the one that uses the least number of hexadecimal digits that it
37 takes to represent the maxval of the input PPM. E.g. if the maxval of
38 the input PPM is 100, ppmtoxpm uses 2 digits per component, as in
39 "#FF0000".
40
41 Some programs do not properly handle one-digit-per-component hexadeci‐
42 mal color specifiers. They see the wrong colors. To produce an XPM
43 that such a program can handle, make sure the maxval of the input PPM
44 is greater than 15, such as by running it through pamdepth 255.
45
46
47 Color Code Lengths - Image Size
48 In the XPM format, there is a palette ("color map") that assigns each
49 color in the image to a unique sequence of printable characters called
50 a color code, and a raster that identifies the color of each pixel of
51 the image with one of those color codes. The length of the color code
52 affects the size of the image stream.
53
54 All color codes in an image are the same length, and ppmtoxpm tries to
55 make it as short as possible. That length is, of course, determined by
56 the number of colors in the image. ppmtoxpm counts the colors in the
57 image, excluding those that will be transparent in the output because
58 of your transparency mask, and chooses a color code length accordingly.
59 There are 92 printable characters that can be used in a color code.
60 Therefore, if you have 92 or fewer colors, your color codes will be one
61 character. If you have more than 92 but not more than 92 * 92, your
62 color codes will be two characters. And so on.
63
64 There's one exception to the above: If you specify a transparency mask
65 (the -alpha option, one unique color code represents "transparent."
66 This is true even if the transparency mask doesn't actually produce any
67 transparent pixels. So subtract one from the number of possible colors
68 if you use -alpha.
69
70
71
73 -name=xpmname
74 This option specifies the prefix string which is specified in
75 the resulting XPM output. If you don't use the -name otpion,
76 ppmtoxpm defaults to the filename (without extension) of the
77 ppmfile parameter. If you do not specify -name or ppmfile (i.e.
78 your input is from Standard Input), the prefix string defaults
79 to the string noname.
80
81
82 -hexonly
83 This option says never to put color names in the XPM file, but
84 rather to identify names by hexadecimal strings that explicitly
85 identify RGB component intensities. This means the reader of
86 the file need not have access to a suitable color dictionary to
87 interpret it.
88
89 This option was introduced in Netpbm 10.15 (April 2003). Before
90 that, it was the default, overridden by specifying -rgb.
91
92
93 -rgb=rgb-textfile
94 This option names the file in which the color dictionary you
95 want to use resides. By default, ppmtoxpm uses the system color
96 dictionary ⟨libppm.html#rgb.txt⟩ , and if it cannot open that
97 file, uses hexadecimal color specifiers.
98
99 This option in meaningless when you specify -hexonly.
100
101 Before Netpbm 10.15 (April 2003), ppmtoxpm did not default to
102 the system color dictionary. If you didn't specify -rgb, ppm‐
103 toxpbm would use only hexadecimal color specifiers.
104
105
106 -alphamask=pgmfile
107 This option names a PGM file to use as a transparency (alpha)
108 mask. The file must contain an image the same dimensions as the
109 input image. ppmtoxpm marks as transparent any pixel whose
110 position in the transparency mask image is at most half white.
111
112 If you don't specify -alphamask, ppmtoxpm makes all pixels in
113 the output opaque.
114
115 ppmcolormask is one way to generate a transparency mask file.
116 You might also generate it by extracting transparency informa‐
117 tion from an XPM file with the -alphaout option to xpmtoppm.
118
119 There are similar options on other Netpbm converters that con‐
120 vert from formats that include transparency information too.
121
122
123
125 ppmcolormask(1), xpmtoppm(1), pamdepth(1), ppm(1) XPM Manual by Arnaud
126 Le Hors lehors@mirsa.inria.fr
127
128
130 Copyright (C) 1990 by Mark W. Snitily.
131
132 Permission to use, copy, modify, and distribute this software and its
133 documentation for any purpose and without fee is hereby granted, pro‐
134 vided that the above copyright notice appear in all copies and that
135 both that copyright notice and this permission notice appear in sup‐
136 porting documentation. This software is provided "as is" without
137 express or implied warranty.
138
139 This tool was developed for Schlumberger Technologies, ATE Division,
140 and with their permission is being made available to the public with
141 the above copyright notice and permission notice.
142
143 Upgraded to XPM2 by Paul Breslaw, Mecasoft SA, Zurich, Switzerland
144 (paul@mecazh.uu.ch), November 8, 1990.
145
146 Upgraded to XPM version 3 by Arnaud Le Hors(lehors@mirsa.inria.fr),
147 April 9, 1991.
148
150 This manual page was generated by the Netpbm tool 'makeman' from HTML
151 source. The master documentation is at
152
153 http://netpbm.sourceforge.net/doc/ppmtoxpm.html
154
155netpbm documentation Feb 22 2003 Ppmtoxpm User Manual(0)