PIX-BW

## Name

pix-bw — combine pix color planes into a bw black and white image

## Synopsis

`pix-bw` [-s `squaresize`] [-w `width`] [-n `height`] [ [-e `ntsc|crt|hdtv|hdr|avg`] [ [ -R `r_weight`] [ -G `g_weight`] [ -B `b_weight`] ] ] [-o `out.bw`] [ [<]`in.pix`] > `out.bw`

## DESCRIPTION

pix-bw will combine or select the color planes of a pix(5) format file from its standard input and produce a black and white bw(5) file on its standard output.

The `-w` `file_width` flag specifies the width of each scanline in the input file, in pixels. The `-n` `file_height` flag specifies the height in scanlines of the input file. They are set to the same value using `-s` `squarefilesize`.

By default all three colors are weighted equally. The `-e` `type` flag can be used to specify a standard weighting scheme; the type choices include:

ntsc

  Weighting used is based on the NTSC primaries and white alignment. Conforming with Rec.ITU-R BT.601-7, this uses 0.299/0.587/0.114 RGB weights. This gives a simplified linear conversion of perceived luminance that reflects human physiological sensitivity to green and least to blue.

crt

  Weighting scheme matches "historic" CRT phosphor chromaticities and a D6500 white alignment. Uses 0.26/0.66/0.08 RGB weights.

hdtv

  Weighting scheme matches "modern" HDTV display chromacities. Uses 0.2126/0.7152/0.0722 RGB weights per Rec.ITU-R BT.709

hdr

  Weighting scheme matches high dynamic range (HDR) chromacities. Uses 0.2627/0.6780/0.0593 RGB weights per Rec.ITU-R BT.2020

avg

  Weighting scheme simply takes the average of all three values (i.e., R + G + B / 3.0).

Individual color plane(s) can be selected via the `-R#`, `-G#`, and `-B#` options. The value used with each flag will be treated as a weight to be applied to that color.

If 0 is supplied by the user for weights, then the weights assigned are 1.0 divided by the number of colors selected.

## EXAMPLES

pix-bw -R0.0 -B0.0 < file.pix > file.bw

will equally blend the red and blue color planes; because -G is omitted, the green color plane is not considered. (Had "-G0.0" been included in this example, the three colors would have been weighted equally, as in the default condition.)

pix-bw -R0.3 -G0.6 -B0.1 < file.pix > file.bw

applies weights close to the `-ntsc` flag.

## SEE ALSO

brlcad(1), pix-bw3(1), bw-pix(1), pix(5), bw(5)

## AUTHOR

BRL-CAD Team

## COPYRIGHT

This software is Copyright (c) 1989-2021 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>`