Skip to documentation
DocumentationAll documentsEnglish

PIX-PPM(1)

NAME

pix-ppm - convert a BRL-CAD PIX or BW image to a PPM/PGM image

On this page

SYNOPSIS

pix-ppm [-a] [-# _bytes_per_pixel_] [-s _squaresize_] [-w _file_width_] [-n _file_height_] [-o _file.ppm_] [_file.pix_] [> _file.ppm_]

DESCRIPTION

pix-ppm converts a pix(5) (or bw(5)) format image into a Netpbm PPM/PGM format image. Three-byte-per-pixel RGB input is written as a binary PPM (P6); single-byte-per-pixel input is written as a binary PGM (P2). Input is read from the named file.pix or, if no file is given, from standard input; output is written to standard output by default.

PIX and BW files carry no embedded dimensions, so the size of the input must be supplied (default 512x512) via -s, -w/-n, or determined automatically with -a.

OPTIONS

-a

Autosize the input file, inferring the image width and height from the file length. Only effective when reading from a named file rather than standard input.

-# bytes_per_pixel

Set the number of bytes per pixel in the input. Must be 3 (RGB, the default) or 1 (grayscale).

-s squaresize

Set both the input width and height to squaresize pixels.

-w file_width

Set the input width to file_width pixels.

-n file_height

Set the input height to file_height scanlines.

-o file.ppm

Write the image to the named output file. If standard output is also redirected or piped, pix-ppm writes the same image to both destinations. pix-ppm refuses to write binary image data to a terminal.

EXAMPLES

Example 1. Convert an autosized PIX rendering to PPM
pix-ppm -a render.pix -o render.ppm

Reads render.pix, infers its dimensions from the file size, and writes a binary PPM file render.ppm suitable for viewing or importing into common image tools.

Example 2. Render and convert in a single pipeline
rt -s 1024 -o /dev/stdout model.g component | pix-ppm -s 1024 > component.ppm

Pipes a 1024x1024 rt(1) raytrace directly into pix-ppm, producing a PPM image without writing an intermediate PIX file to disk.

SEE ALSO

brlcad(1), rt(1), pix-png(1), pix-bw(1), bw-pix(1), pix-fb(1), pix(5), bw(5)

AUTHOR

BRL-CAD Team

This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.

BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org