I would like to be able to fetch 1-N dark colors, 1-N bright colors, and 1-N most used colors from an image. I can use these as lowlights, highlights, and generic other colors in my theming process.
What I've tried already is:
Code: Select all
convert 5Wvr0xU.jpg +dither -colors 5 -define histogram:unique-colors=true -format "%c" histogram:info:
875250: ( 27, 21, 44) #1B152C srgb(27,21,44)
320626: ( 75, 46, 77) #4B2E4D srgb(75,46,77)
427105: ( 93, 7, 47) #5D072F srgb(93,7,47)
379734: (187, 35, 68) #BB2344 srgb(187,35,68)
70885: (237,159,144) #ED9F90 srgb(237,159,144)
Another solution I've tried was:
Code: Select all
convert 5Wvr0xU.jpg -scale 1x1\! -format '%[pixel:u]' info:-
srgb(86,29,57)
So is it possible for imagemagick to distinguish between dark colors and light colors from an image and return them in hex format for usage using separate function calls? I would like to only get the dark colors, then only get the light colors, then only get the generic colors per call to imagemagick.
Thanks.