Page 1 of 1

Understanding the theory of color reductuion

Posted: 2009-01-23T09:12:31-07:00
by barrettsmail
Not sure this the right topic. I am looking for a good tutorial on the basci algorithm for color reduction. Thanks :D

Re: Understanding the theory of color reductuion

Posted: 2009-01-23T09:59:48-07:00
by magick
See http://www.imagemagick.org/script/quantize.php for a discussion of ImageMagick's color reduction algorithm.

Re: Understanding the theory of color reductuion

Posted: 2009-01-23T11:28:15-07:00
by barrettsmail
Thanks.

I had found a web article that is almost word for word identical your reference. That document credited:

"Paul Raveling, USC Information Sciences Institute, for the original idea of using space subdivision for the color reduction algorithm. With Paul's permission, this document is an adaptation from a document he wrote."

I have searched sites such as ACM for that article. Do you know where to find it?

The overview of the algorithm is clear, but I am confused about the node strucure and the reason for the parameters and how they are related to complete process.

Re: Understanding the theory of color reductuion

Posted: 2009-01-23T12:56:59-07:00
by magick
There is no original article. We based the ImageMagick color reduction algorithm on some original source code that Paul provided many years ago. There are tens of different methods for color reduction in the wild including those based on histogram analysis, neural networks, and spatial subdisvision (both k-means and oct-tree). If you want to understand ImageMagick's method we refer you to the article and the source code. Download the ImageMagick source distribution and look at magick/quantize.c. The nodes are inner and leaf nodes of an oct-tree. The tree is populated based on the image pixels and then a reduction process starts where nodes deep in the tree are combined with near-by nodes such that the color error is minimized. When the number of unique colors is equal or less than the desired color count, the original image is replaced by the closest color found in the tree.

Re: Understanding the theory of color reductuion

Posted: 2009-01-23T13:18:37-07:00
by barrettsmail
Thanks for your supe answer. I suspected that may be the case. Being lazy, I wanted a short cut. Again thanks

Re: Understanding the theory of color reductuion

Posted: 2009-01-23T18:52:29-07:00
by anthony
While I do not go into the nitty gritty of Color Reduction I talk about it and its effects in IM Examples, Quantization and Dithering
http://www.imagemagick.org/Usage/quantize/