Color Quantization of Photographic Images II: Palette from Colors out of Color Schemes

Color quantization reduces the number of colors in an image to a limited set of distinct colors, called a palette.
This Demonstration illustrates how a photographic image can be quantized using a palette of six colors from any of the color schemes available in Mathematica.
Use the arrow-shaped locator objects to select six colors within one of the color schemes. The selected image is then quantized with a palette consisting of these colors by using the built-in Mathematica function Nearest. Similarity of colors is evaluated by the Euclidean distance between their RGB values.


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


The code for the "multiSlider" is based on a Demonstration by Brett Champion: "Effects of Bin Width and Height in a Histogram".
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.