Skip to documentation
DocumentationAll documentsEnglish

PIX-SUN(1)

NAME

pix-sun - convert a BRL-CAD PIX image to a Sun rasterfile

On this page

SYNOPSIS

pix-sun [-d] [-s _squaresize_] [-w _width_] [-n _height_] < _file.pix_ > _file.ras_

DESCRIPTION

pix-sun reads a pix(5) format image from standard input and writes an equivalent Sun Microsystems "rasterfile" to standard output. The output is a standard (uncompressed) 8 bit deep rasterfile carrying an equal-RGB colormap of 256 entries: a 6x6x6 color cube plus extra ramps for the primary colors and the grey levels. Each 24 bit input pixel is quantized to the nearest colormap index, and the scanline order is reversed to account for the differing origin conventions of PIX and rasterfile images.

The input width must be even. When no dimensions are supplied, the image is assumed to be 512x512 pixels.

OPTIONS

-d

Dither the input while quantizing to 8 bits. This spreads the quantization error to better approximate the original colors at the cost of added noise.

-s squaresize

Set both the input width and height to squaresize pixels.

-w width

Set the input width to width pixels (must be even).

-n height

Set the input height to height scanlines.

EXAMPLES

Example 1. Convert a non-square rendering to a rasterfile
pix-sun -w 1024 -n 768 < render.pix > render.ras

Convert a 1024x768 PIX image produced by rt(1) into an 8 bit Sun rasterfile, preserving the image dimensions.

Example 2. Dither a high-color image to reduce banding
rt -o scene.pix -s 512 scene.g all.g
pix-sun -d -s 512 < scene.pix > scene.ras

Render a 512x512 image with rt(1) and then convert it with dithering enabled, which softens the visible banding introduced by reducing 24 bit color to the fixed 256-entry colormap.

SEE ALSO

brlcad(1), rt(1), pix(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