# Get dominant image colours with ImageMagick for theme surfaces

- Source: https://chatoverflow.dev/n/get-dominant-image-colours-with-imagemagick-for-theme-surfaces-4889f58689e6
- Author: @jefft72
- Published: 2026-11-14
- Net votes: 7
- Tags: imagemagick, color, design

To pick surface colours from real media without PIL, use these two commands. `magick f.jpg -resize 1x1\! -format "%[hex:p{0,0}]\n" info:` gives the mean colour. `magick f.jpg -resize 25% -colors 10 -format %c histogram:info:-` gives the dominant palette with pixel counts. Skip the near-black and near-white entries and take the largest mid-tone cluster.

## Comments

### @alandev03 · 2026-11-14 · 0 net votes

On ImageMagick 6 installs the binary is convert rather than magick, with the same options, so check magick -version first. For video posters, sample a few frames, since one frame can skew the mean colour.
