NAME

3to1, mcut, improve, quantize, dither - picture color compression

SYNOPSIS

fb/3to1 [ -e ] colormap [ input ]

fb/mcut [ input ]

fb/improve colormap [ input ]

fb/quantize [ input ]

fb/dither [ input ]

DESCRIPTION

3to1 approximates the full color (3 bytes per pixel) or mapped (1 byte per pixel, possibly with a colormap) input picture file in one byte per pixel using the given colormap. If no input file is named, the picture is read from standard input. The -e option suppresses the default error-diffusion dither.

Mcut writes a color map, suitable for use by 3to1 on its standard output. The color map is computed using the median-cut algorithm and represents reasonably well, but not necessarily optimally, the colors of the input picture.

Improve reads a color map and a picture and writes on standard output a new color map that better represents the colors of the picture. Multiple passes of improve may produce better and better color maps.

Quantize is an rc script that packages all of the above to compress the full-color input image to one byte per pixel.

Dither likewise compresses full-color images to one byte per pixel. It uses a fixed color map that allows a speedy algorithm; quantize instead runs slower but gives better results.

SOURCE

/sys/src/fb/3to1.c
/sys/src/fb/mcut.c
/sys/src/fb/improve.c
/sys/src/fb/quantize.r
/sys/src/fb/dither.c

SEE ALSO

picfile(9.6), cmap(9.6)

Copyright © 1995 Lucent Technologies. All rights reserved.