DominantColors[image, n]
returns at most n dominant colors in image.


  • DominantColors returns a list of colors that represent clusters of colors that appear in the image. The colors are represented by GrayLevel or RGBColor.
  • The returned colors are ordered based on the size of the clusters they represent.
  • DominantColors uses the Lab color space to find color clusters.
  • With the setting Masking->region, a region of interest can be specified.
  • DominantColors works with Image3D objects.

ExamplesExamplesopen allclose all

Basic Examples (2)Basic Examples (2)

Find eight common colors in an image:

Click for copyable input

Create and visualize a color palette:

Click for copyable input
New in 9
New to Mathematica? Find your learning path »
Have a question? Ask support »