Skip to documentation
DocumentationAll documentsEnglish

PIX-FB(1)

NAME

pix-fb - display a pix format RGB image on a framebuffer

On this page

SYNOPSIS

pix-fb [-a] [-i] [-c] [-z] [-1] [-m _#lines_] [-F _framebuffer_] [-s _squarefilesize_] [-w _file_width_] [-n _file_height_] [-S _squarescrsize_] [-W _scr_width_] [-N _scr_height_] [-x _file_xoff_] [-y _file_yoff_] [-X _scr_xoff_] [-Y _scr_yoff_] [-p _seconds_] [_file.pix_]

DESCRIPTION

pix-fb reads a pix(5) format RGB image from the named file, or from standard input if no file is given, and displays it on a framebuffer. The framebuffer defaults to the device named by the FB_FILE environment variable (see brlcad(1)) and can be overridden with -F.

A pix(5) file stores each pixel as three unsigned char bytes (red, green, blue) with the first pixel at the lower-left corner; scanlines run left-to-right, bottom-to-top. By default the image is assumed to be 512x512 pixels, and the framebuffer is opened at the file’s dimensions unless an explicit screen size is requested.

To go the other direction (save a framebuffer image to a pix(5) file), use fb-pix(1).

OPTIONS

-a

Autosize the input. The file’s byte count is compared against a table of common image dimensions and the matching width and height are used. Requires file input (not a pipe).

-i

Invert the image, displaying it top-to-bottom. Since pix(5) files are stored bottom-to-top, this turns the image upside down.

-c

Clear the framebuffer before displaying. By default the new image overwrites whatever is already on screen without clearing.

-z

Zoom and center the image to fill the display, using integer zoom factors via the framebuffer library’s fb_view() routine.

-1

Force one scanline per write using fb_write(3). This is the default and overrides -m.

-m #lines

Write the image in rectangular blocks of #lines scanlines using fb_writerect(3). This can be significantly faster on some framebuffers. Only used in the simplest non-inverted, non-zoomed, full-width case.

-F framebuffer

Use the named framebuffer device instead of the one given by FB_FILE.

-s squarefilesize

Set both the input width and height to squarefilesize pixels (disables autosizing).

-w file_width

Set the input scanline width, in pixels (disables autosizing).

-n file_height

Set the input height, in scanlines (disables autosizing).

-S squarescrsize

Set both the screen width and height to squarescrsize pixels.

-W scr_width

Set the screen width, in pixels.

-N scr_height

Set the screen height, in pixels.

-x file_xoff

Skip file_xoff pixels in from the left edge of the input. Origin is the lower-left corner.

-y file_yoff

Skip file_yoff scanlines up from the bottom of the input.

-X scr_xoff

Offset the image scr_xoff pixels horizontally on the screen (may be negative).

-Y scr_yoff

Offset the image scr_yoff pixels vertically on the screen (may be negative).

-p seconds

Pause seconds seconds before closing the framebuffer and exiting.

EXAMPLES

Example 1. Render and display a model
rt -o moss.pix -w 1024 -n 1024 moss.g all.g
pix-fb -F /dev/X -a moss.pix

Ray traces the all.g object from the moss.g database into a 1024x1024 pix(5) image, then displays it on an X11 framebuffer. The -a flag autosizes from the file so the explicit dimensions need not be repeated.

Example 2. Pause so the result stays visible
pix-fb -w 512 -n 512 -p 5 render.pix

Displays a 512x512 image and keeps the framebuffer open for 5 seconds before closing, useful in scripts or pop-up framebuffers that would otherwise vanish immediately.

SEE ALSO

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