Lunch atop a (Springfield) skyscraper

Lunch atop a (Springfield) skyscraper
by andy-m                

Submit your Photo
Hall of Fame

Please participate in Meta
and help us grow.

Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is anybody aware of free software that can sort your pictures by overall color (or color of a specific region of an image)?

I've checked this question and looked into imgSeek, but the Mac version download links to a Japanese news site.

I've also tried the experimental feature in Picasa, but it 1) doesn't sort (it only searches) and 2) doesn't have a wide breadth of options to choose from.

share|improve this question
What are you trying to accomplish with this? – mattdm Oct 11 '13 at 1:05
I have a directory full of images, and I'm hoping to somehow sort these images (so that, say, all of the predominantly red images appear first). Does that make sense? – Atticus29 Oct 11 '13 at 2:12
Sure, that helps. But, why? – mattdm Oct 11 '13 at 2:33
Because they are images of moths that I have to identify by species, and it will greatly help my workflow if similarly-colored moths are adjacent. – Atticus29 Oct 11 '13 at 14:53

ImageMagick is your friend

~> convert image.jpg -gravity center -crop 80x80%+0+0 -scale 1x1\! txt:-
# ImageMagick pixel enumeration: 1,1,255,srgb
0,0: (131, 89, 61)  #83593D  rgb(131,89,61)

This works by cropping away the outer 20% edge (gravity center indicates a crop of the outside edges). It then scales the image down to a single pixel and outputs that to the screen (if you replace the - at the end of the line with a filename you can write the output to a file). You can also experiment with resize/filter options, but scale is going to be quite a bit faster and for this application, I expect perfect.

Note that these values are Red/Green/Blue values, how you sort is another issue. You can pick the highest values and assume it is predominant, but that is probably not going to get the result you want, changing to either HSL or HSB is probably going to provide a more useful set of values for sorting:

~> convert image.jpg -gravity center -crop 80x80%+0+0 -scale 1x1\! -colorspace hsl txt:-
# ImageMagick pixel enumeration: 1,1,255,srgb
0,0: ( 19, 76,162)  #134CA2  hsl(7.46929%,29.8466%,63.5111%)


~> convert image.jpg -gravity center -crop 80x80%+0+0 -scale 1x1\! -colorspace hsb txt:-
# ImageMagick pixel enumeration: 1,1,255,srgb
0,0: ( 19, 75,190)  #134BBE  hsb(7.46929%,29.276%,74.4015%)

Sorting from here is not too difficult in shell script.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.