ColorQuantize[image, n]
gives an approximation to image that uses only n distinct colors.

Details and OptionsDetails and Options

  • ColorQuantize by default uses dithering to diffuse color quantization errors.
  • With Dithering->False, no dithering is applied.
  • ColorQuantize works with grayscale, color, and arbitrary multichannel images.
  • For grayscale and images with three color channels, ColorQuantize works on the original color space. For other color images, quantization is done in the Lab color space. For images with Automatic color space, ColorQuantize works on pixel intensities by averaging over all channels.
  • ColorQuantize works with Image3D objects.
New in 7 | Last modified in 9
New to Mathematica? Find your learning path »
Have a question? Ask support »