Convert Full-Color Images to 8-bit Delayed-Color Images

Quantize is used to convert full-color images to 8-bit delayed-color images using an intelligently selected colormap (that described in "A Simple Method for Color Quantization: Octree Quantization" by Gervautz and Pergathofer in Graphics Gems). Generally, each image is assigned its own colormap; however, if the input contains a series of images, a single colormap is chosen for all the images contained in the series and is associated with the entire series as a "color map" attribute on the series.

Delayed-color images can be displayed without dithering by adding an attribute named "direct color map" to the image before being passed to Display. This is added by Quantize to the output delayed-color image by default.

A demo network is included. This renders an image and then displays it in three windows: a 24 bit full-color window, a dithered 8-bit window and an undithered 8-bit window, using the result of Quantize.

The handling of series is particularly useful in conjunction with Cine.

To make the executive: make dxexec

To run the demo: dx -mdf Quantize.mdf -exec ./dxexec Quantize

Directory name: contrib/modules/quantize

Other files in this directory:

Return to Assorted Useful Modules

See license


[ Previous Page | Next Page | Table of Contents | DX Home Page ]
[ IBM home page | Order | Search | Contact IBM | Help | (C) | (TM) ]