Skip to content
Quentin Barrand edited this page May 4, 2021 · 1 revision

To get an image's main / dominant colour, one can use the following shell one-liner:

convert "${FILENAME}" -depth 8 +dither -colors 1 -format "%c" histogram:info: | sed -n 's/^[ ]*\(.*\):.*[#]\([0-9a-fA-F]*\) .*$/\1,#\2/p'

This requires ImageMagick to be installed.

Clone this wiki locally