Skip to documentation
DocumentationAll documentsEnglish

PIXHIST(1)

NAME

pixhist - display a color histogram of a pix file on a framebuffer

On this page

SYNOPSIS

pixhist [-v] [file.pix]

DESCRIPTION

pixhist reads a pix(5) format color image and displays a per-channel histogram of its pixel values on the current framebuffer. If no file.pix is given, the image is read from standard input. The framebuffer is selected via the FB_FILE environment variable, falling back to the system default device (see brlcad(1)).

The histogram is drawn into a 512x512 framebuffer. Each of the 256 possible intensity levels occupies two scan lines; level 0 is at the top of the display and level 255 at the bottom. For each level the relative frequency is drawn as a horizontal bar extending along the x axis, with the red, green, and blue channels overlaid on the same line. All three channels are scaled by the same factor so that the most populous bin spans the full width. The result is drawn over whatever is already on the display.

The peak bin count and the resulting scale factor are always reported on standard error.

OPTIONS

-v

Verbose. In addition to the framebuffer display, print the red, green, and blue counts (and the bar length) for each of the 256 levels on standard error. If present, this flag must appear before the optional file name.

EXAMPLES

Example 1. Inspect the tonal distribution of a rendered image
rt -o frame.pix model.g component &&
pixhist -v frame.pix

Renders a region to a pix(5) image with rt(1), then displays its color histogram on the framebuffer while also printing the per-level red, green, and blue counts to the terminal. Heavy clustering of bins near level 0 or 255 indicates an underexposed or clipped image.

SEE ALSO

brlcad(1), pixhist3d(1), pixstat(1), rt(1), pix(5)

BUGS

This program assumes the framebuffer has at least 512 lines in y to work with.

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