1 / 34

Color Quantization

Color Quantization. Color Quantization. Common color resolution for high quality images is 256 levels for each Red , Greed , Blue channels, or 256 = 16777216 colors. How can an image be displayed with fewer colors than it contains?

edacosta
Download Presentation

Color Quantization

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Color Quantization

  2. Color Quantization Common color resolution for high quality images is 256 levels for each Red, Greed, Blue channels, or 256 = 16777216 colors. How can an image be displayed with fewer colors than it contains? Select a subset of colors (the colormap or pallet) and map the rest of the colors to them. 3

  3. Color Quantization • With 8 bits per pixel and color look up table we can display at most 256 distinct colors at a time. • To do that we need to choose an appropriate set ofrepresentative colors and map the imageinto these colors

  4. 2 colors 16 colors 4 colors 256 colors Color Quantization

  5. Quantization phases • Sample the original image for color statistics • Select color map based on those statistics • Map the colors to their representative in the color map • Redraw the image, quantizing each pixel Algorithm Mapping…

  6. Naïve Color Quantization 24 bit to 8 bit: Retaining 3-3-2 most significant bits of the R,G and B components.

  7. 3-3-2

  8. 3-3-2

  9. Popularity16 colors…

  10. Popularity16 colors… The reds are not that popular…

  11. Median Cut R G B

  12. Median Cut

  13. Median Cut

  14. Median Cut

  15. Median Cut

  16. Median Cut

  17. The median cut algorithm Color_quantization(Image, n){ For each pixel in Image with color C, map C in RGB space; B = {RGB space}; While (n-- > 0) { L = Heaviest (B); Split L into L1 and L2; Remove L from B, and add L1 and L2 instead; } For all boxes in B do assign a representative (color centroid); For each pixel in Image do map to one of the representatives; }

  18. The median cut algorithm • Is this algorithm image dependent? • What is the Heaviest(B) box? • Several factors have to be weighed: • The total number of image colors in the box. • The total number of DIFFERENT image colors in the box. • The physical size of the box. • Which representative should be chosen for a given color? • The representative of the box containing the color. • The closest representative under some metric.

  19. A better solution

  20. Median Cut

  21. Generalized Llyod Algorithm - GLA ei

  22. Generalized Llyod Algorithm - GLA ei

  23. Generalized Llyod Algorithm - GLA ei

  24. 8 indexed colored Original image

  25. 8 indexed colored 32 indexed colored

  26. 128 indexed colored Original image

  27. 8 levels per channel that is, 9 bits per pixel

  28. 24 bit 8 bit 4 bit

  29. Original Image

  30. Threshholding

  31. Bayer’s Ordered Dithering

  32. Error Diffusion

  33. Median Cut (4 levels)

  34. Median Cut (8 levels)

More Related