Skip to documentation
DocumentationAll documentsEnglish

PIXFADE(1)

NAME

pixfade - darken a pix file

On this page

SYNOPSIS

pixfade [-f fraction] [-p percentage] [-m max] [-s squaresize] [-w width] [-n height] [-o out_file.pix] [infile.pix] [> outfile.pix]

DESCRIPTION

pixfade darkens a color pix(5) image, either by scaling every pixel by a fractional amount or by clamping each color channel to a maximum level.

By default pixfade operates in scaling mode: the -f option gives a non-negative fractional multiplier applied to the red, green, and blue values of each pixel, and the -p option specifies the same multiplier as a non-negative percentage. The default is -f 0.5 (-p 50.0).

The -m option selects truncation mode instead, supplying a ceiling pixel level (0 - 255). Each channel is replaced by the minimum of the ceiling and its original value. When -m is given, the -f and -p options are ignored.

Input is read from infile.pix if given, otherwise from standard input. The faded image is written to standard output, and additionally to the -o file when one is named; if both an output file and a redirected standard output are present, the same image is written to each.

OPTIONS

-f fraction

Scale every channel of each pixel by fraction, a non-negative multiplier (clamped to 0 - 255). Default is 0.5.

-p percentage

Same as -f but expressed as a non-negative percentage; percentage is divided by 100 to form the multiplier. Default is 50.0.

-m max

Truncation mode: clamp each channel to the ceiling max (0 - 255). Values outside this range are clamped to the nearest bound. Overrides -f and -p.

-s squaresize

Set both input width and height to squaresize pixels.

-w width

Set the input scanline width in pixels. Default is 512.

-n height

Set the number of input scanlines in pixels. Default is 512.

-o out_file.pix

Write the faded image to out_file.pix in addition to standard output.

EXAMPLES

Example 1. Dim an image to a quarter brightness
pixfade -f 0.25 -w 1024 -n 768 scene.pix > dim.pix

Reads the 1024x768 image scene.pix and scales every channel to 25% of its original value, producing a darkened dim.pix.

Example 2. Clamp highlights and view the result
pixfade -m 200 scene.pix | pix-fb -w 512 -n 512

Caps each color channel at 200 to tame bright highlights, then pipes the result straight to a framebuffer with pix-fb(1) for inspection.

SEE ALSO

brlcad(1), pix-fb(1), pixscale(1), pix(5)

AUTHOR

BRL-CAD Team

This software is Copyright (c) 1991-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