# 颜色量化

流行色算法(popularity algorithm)

The initial idea of the popularity algorithm is to build the colormap by finding the K most frequently appearing colors in the original image.

Therefore the colors are stored in a histogram. The K most frequently occuring colors are extracted and they are made the entries in the color table. Now the true image can be quantized.

Popularity algorithms are another form of uniform quantization. However, instead of dividing the color space into 256 regions these algorithms break the color space into much smaller, and consequently many more, regions. One possible implementation is to divide the space into regions 4x4x4 in size (262,144 regions). The original colors are again mapped to the region they fall in. The representative color for each region is the average of the colors mapped to it. The color map is selected by taking the representative colors of the 256 most popular regions (the regions that had the most colors mapped to them). If a non-empty region is not selected for the color map its index into the color map (the index that will be assigned to colors that map to that region) is then the entry in the color map that is closest (Euclidean distance) to its representative color).

0对应全黑,255对应全白.

Heckbert’s median-cut algorithm is an image-based, color-quantization algorithm that gives good results for many images. If properly implemented, it’s also quite fast.

1. Create a block or box surrounding the points; it should be just large enough to contain them all.
2. While the number of blocks is less than the desired palette size:
1. Find the block with the longest side out of all blocks.
2. Cut this block into two blocks along its longest side. Cut it in such a way that half of the points inside the block fall into each of the two new blocks (that is, we split it through the median, thus the name).
3. Shrink these two new boxes so that they just barely contain their points.
3. Average the points in each box to obtain the final set of palette colors.

### TomTom

BlueAsteroid

Just another WordPress.com site

Jing's Blog

Just another WordPress.com site

Start from here......

Just another WordPress.com site

Where On Earth Is Waldo?

A Project By Melanie Coles

the Serious Computer Vision Blog

A blog about computer vision and serious stuff

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision

datarazzi

Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness

1,2,∞

Dr Paul Tennent

and the university of nottingham