Simple Image Metrics with PIL

I want to process uploaded photos using PIL and define some β€œsoft” image metrics, for example:

  • Is the image contrasting or boring?
  • color or monochrome
  • bright or dark?
  • Is the image warm or cold (relative to light temperature)?
  • is there a dominant shade?

metrics should be measured in a rating style, for example. colorful ++++ for a very vivid photo, colorful + for a pretty monochrome image.

I already noticed the PIL ImageStat Module, which calculates some interesting values ​​for my indicators, for example. RMS histograms, etc. However, this module is rather poorly documented, so I'm looking for more specific algorithms for determining these indicators.

+4
source share
1 answer

I don’t think there are methods that give you the metric exactly for what you want, but the methods that it has, like RMS, have come a long way. To do something with color, you can divide the image one level into color and get RMS at each level, which tells you about some things you want to know. You can also convert the image in different ways to save color information, etc.

+1
source

Source: https://habr.com/ru/post/1286668/


All Articles