.TL Ppmtoxpm User Manual .SH 1 ppmtoxpm .LP Updated: Feb 22 2003 .br Table Of Contents .SH 2 NAME .LP ppmtoxpm - convert a PPM image to an X11 pixmap .SH 2 SYNOPSIS .LP \fBppmtoxpm \fR [\fB-name=\fR\fIxpmname\fR] [\fB-hexonly\fR] [\fB-rgb=\fR\fIrgb-textfile\fR] [\fB-alphamask=\fR\fIpgmfile\fR] [\fIppmfile\fR] .LP Minimum unique abbreviation of option is acceptable. You may use double hyphens instead of single hyphen to denote options. You may use white space in place of the equals sign to separate an option name from its value. .SH 2 DESCRIPTION .LP .LP This program is part of Netpbm. .LP \fBppmtoxpm\fR reads a PPM image as input and produces X11 pixmap (version 3) as output. This format can be loaded by the XPM library. .LP In the XPM output, colors may be identified by name, such as "Red", or in hexadecimal, for example "#FF0000". In the hexadecimal format, there may be from 1 through 4 hexadecimal digits per RGB component. .LP By default, \fBppmtoxpbm\fR tries to find a name for each color in the image in the system color dictionary, and if it finds one, uses it. If it doesn't it uses hexadecimal. You can force \fBppmtoxpbm\fR to use hexadecimal only with the \fB-hexonly\fR option. You can specify a different color dictionary with the \fB-rgb\fR option. .LP When \fBppmtoxpm\fR uses the hexadecimal format for identifying a color, it uses the one that uses the least number of hexadecimal digits that it takes to represent the maxval of the input PPM. E.g. if the maxval of the input PPM is 100, \fBppmtoxpm\fR uses 2 digits per component, as in "#FF0000". .LP Some programs do not properly handle one-digit-per-component hexadecimal color specifiers. They see the wrong colors. To produce an XPM that such a program can handle, make sure the maxval of the input PPM is greater than 15, such as by running it through \fBpamdepth 255\fR. .SH 3 Color Code Lengths - Image Size .LP .LP In the XPM format, there is a palette ("color map") that assigns each color in the image to a unique sequence of printable characters called a color code, and a raster that identifies the color of each pixel of the image with one of those color codes. The length of the color code affects the size of the image stream. .LP All color codes in an image are the same length, and \fBppmtoxpm\fR tries to make it as short as possible. That length is, of course, determined by the number of colors in the image. \fBppmtoxpm\fR counts the colors in the image, excluding those that will be transparent in the output due to your alpha mask, and chooses a color code length accordingly. There are 92 printable characters that can be used in a color code. Therefore, if you have 92 or fewer colors, your color codes will be one character. If you have more than 92 but not more than 92 * 92, your color codes will be two characters. And so on. .LP There's one exception to the above: If you specify an alpha mask (the \fB-alpha\fR option, one unique color code represents "transparent." This is true even if the alpha mask doesn't actually produce any transparent pixels. So subtract one from the number of possible colors if you use \fB-alpha\fR. .SH 2 OPTIONS .LP .RS .IP "\fB-name=\fR\fIxpmname\fR" This option specifies the prefix string which is specified in the resulting XPM output. If you don't use the \fB-name\fR otpion, \fBppmtoxpm\fR defaults to the filename (without extension) of the \fIppmfile\fR parameter. If you do not specify \fB-name\fR or \fIppmfile\fR (i.e. your input is from Standard Input), the prefix string defaults to the string \fBnoname\fR. .IP "\fB-hexonly\fR" This option says never to put color names in the XPM file, but rather to identify names by hexadecimal strings that explicitly identify RGB component intensities. This means the reader of the file need not have access to a suitable color dictionary to interpret it. .LP This option was introduced in Netpbm 10.15 (April 2003). Before that, it was the default, overridden by specifying \fB-rgb\fR. .IP "\fB-rgb=\fR\fIrgb-textfile\fR" This option names the file in which the color dictionary you want to use resides. By default, \fBppmtoxpm\fR uses the system color dictionary. .LP This option in meaningless when you specify \fB-hexonly\fR. .LP Before Netpbm 10.15 (April 2003), \fBppmtoxpm\fR did not default to the system color dictionary. If you didn't specify \fB-rgb\fR, \fBppmtoxpbm\fR would use only hexadecimal color specifiers. .IP "\fB-alphamask=\fR\fIpgmfile\fR" This option names a PGM file to use as an alpha (transparency) mask. The file must contain an image the same dimensions as the input image. \fBppmtoxpm\fR marks as transparent any pixel whose position in the alpha mask image is at most half white. .LP If you don't specify \fB-alphamask\fR, \fBppmtoxpm\fR makes all pixels in the output opaque. .LP \fBppmcolormask\fR is one way to generate an alpha mask file. You might also generate it by extracting transparency information from an XPM file with the \fB-alphaout\fR option to \fBxpmtoppm\fR. .LP There are similar options on other Netpbm converters that convert from formats that include transparency information too. .RE .SH 2 SEE ALSO .LP \fBppmcolormask\fR, \fBxpmtoppm\fR, \fBpamdepth\fR, \fBppm\fR .br XPM Manual by Arnaud Le Hors lehors@mirsa.inria.fr .SH 2 AUTHOR .LP .LP Copyright (C) 1990 by Mark W. Snitily. .LP 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. This software is provided "as is" without express or implied warranty. .LP This tool was developed for Schlumberger Technologies, ATE Division, and with their permission is being made available to the public with the above copyright notice and permission notice. .LP Upgraded to XPM2 by Paul Breslaw, Mecasoft SA, Zurich, Switzerland (paul@mecazh.uu.ch), November 8, 1990. .LP Upgraded to XPM version 3 by Arnaud Le Hors(lehors@mirsa.inria.fr), April 9, 1991. .br \l'5i' .SH 2 Table Of Contents .LP .IP \(bu NAME .IP \(bu SYNOPSIS .IP \(bu DESCRIPTION .IP \(bu OPTIONS .IP \(bu SEE ALSO .IP \(bu AUTHOR .LP