PPMTOPCX(1)
π Ppmtopcx User Manual(1) π
okay bestie, pull up a chair, because we're about to talk about ppmtopcx, which lives in the General Commands Manual section of your local man pages, and honestly? she's iconic. π
β¨ NAME β¨
ppmtopcx β convert a PPM image to a PCX file π¦
πΈ SYNOPSIS πΈ
ppmtopcx
[-24bit]
[-8bit]
[-packed]
[-stdpalette]
[-palette=palettefile]
[-planes=planes]
[-xpos=cols]
[-ypos=rows]
[ppmfile]
π DESCRIPTION π
so first things first: this program is part of Netpbm(1), iykyk. β¨
ppmtopcx reads a PPM image as input and produces a PCX file as output. and the type of PCX file it makes? that depends entirely on how many colors are in your input image, no cap:
- 16 colors or fewer: 1 bit/pixel, 1-4 planes, colormap in header
- more than 16 colors, but no more than 256: 8 bits/pixel, 1 plane, colormap at the end of the file.
- More than 256 colors: 24bit truecolor file (8 bits/pixel, 3 planes).
and the best part?? you can override some of that and explicitly choose the format with the options below. main character energy fr fr. π
π OPTIONS π
In addition to the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), ppmtopcx recognizes the following command line options:
-24bitβ Produce a 24bit truecolor PCX file, even if the image has 256 colors or fewer. like, we're going full color bestie, no downsizing here π-8bitβ Produce an 8bit (256 colors) PCX file, even if the image has 16 colors or fewer.
This option was added in Netpbm 10.18 (August 2003). β¨
-packedβ Use "packed pixel" format for files with 16 colors or fewer: 1, 2, or 4 bits/pixel, 1 plane. π¦-stdpaletteβ 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,ppmtopcxfails. π
The standard palette is not only a set of colors, but a specific mapping of palette indexes to colors. E.g. red is 4.
You can use pnmremap with a suitable PPM image of the standard palette to adapt your image to use exactly those colors in the palette so that ppmtopcx -stdpalette will work on it. genius behavior, honestly π«Ά
The file pcxstd.ppm, part of Netpbm, contains the standard palette.
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 -stdpalette option, ppmtopcx, ppmtopcx 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. π so yeah, vintage tech being vintage tech.
You cannot specify this option along with -palette.
This option was new in Netpbm 10.22 (April 2004). β
-palette=palettefileβ Instead of computing the palette from the colors in the image, use the palette from the file palettefile. If the palette contains a color that is not in that palette,ppmtopcxfails. π
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, ppmtopcx chooses between them arbitrarily in building the PCX raster.
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 -stdpalette option. π
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 pnmremap.
You cannot specify this along with -stdpalette.
This option was new in Netpbhm 10.25 (October 2004). β¨
-planes=planesβ Generate a PCX file with planes 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. not her being extra on purpose, we love a flexible queen π
This is meaningful only when ppmtopcx generates an image in the 16 color palette format without packed pixels. Consequently, you cannot specify this option together with -24bit or -8bit or -packed.
The valid values for planes are 1, 2, 3, and 4. By default, ppmtopcx chooses the smallest number of planes that can represent the colors in the image. E.g. if there are 5 colors, ppmtopcx chooses 3 planes.
This option was new in Netpbm 10.21 (March 2004). πΈ
-xpos=cols-ypos=rowsβ 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, usingpnmpadto 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. π€
The values may be from -32767 to 32768.
The default for each is zero.
ok so real talk: don't skip the position stuff, it's giving "technically different image" and you WILL get confused if you're not paying attention π
π¦ SEE ALSO π¦
pcxtoppm(1), ppm(1)
π AUTHORS π
Copyright (C) 1994 by Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de)
Based on previous work by Michael Davidson.
π DOCUMENT SOURCE π
This manual page was generated by the Netpbm tool makeman from HTML source. The master documentation is at
http://netpbm.sourceforge.net/doc/ppmtopcx.html
and that's the whole vibe, bestie π«Ά this lil love letter was brought to you by the netpbm documentation, dated 26 September 2020, and it's literally slaying under the title Ppmtopcx User Manual(1). go forth and convert those PPMs, you got this πβ¨π
π¦ where this page comes from
- debian bookworm: netpbm 2:11.01.00-2 Β· MIT
- debian trixie: netpbm 2:11.10.02-1 Β· MIT
- ubuntu noble: netpbm 2:11.05.02-1.1build1 Β· MIT
- ubuntu resolute: netpbm 2:11.10.02-1build1 Β· MIT
- ubuntu stonking: netpbm 2:11.13.03+ds-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms