tags:

views:

124

answers:

1

I want to process uploaded photos with PIL and determine some "soft" image metrics like:

  • is the image contrastful or dull?
  • colorful or monochrome?
  • bright or dark?
  • is the image warm or cold (regarding light temperature)?
  • is there a dominant hue?

the metrics should be measured in a rating-style, e.g. colorful++++ for a very colorful photo, colorful+ for a rather monochrome image.

I already noticed PIL's ImageStat Module, that calculates some interesting values for my metrics, e.g. RMS of histogram etc. However, this module is rather poorly documented, so I'm looking for more concrete algorithms to determine these metrics.

+1  A: 

I don't think there are methods that give you a metric exactly for what you want, but the methods that it has, like RMS, takes you a long way there. To do things with color, you can split the image into one layer per color, and get the RMS on each layer, which tells you some of the things you want to know. You can also convert the image in different ways so that you only retain color information, etc.

Lennart Regebro