0

I have searched the internet thoroughly but not much related questions. Even on stackoverflow there is none

So what I want to achieve is rather hard thing to do

I want to calculate complexity of images

Let me show you several examples from the game I develop https://www.monstermmorpg.com/MonsterDex

A very complex and highly detailed Monster artwork I have e.g.

https://www.monstermmorpg.com/Vesuverex-Monster-Dex-18

enter image description here

And another one which is pretty simplistic

https://www.monstermmorpg.com/Cluckoon-Monster-Dex-152

enter image description here

So I want to calculate complexity of images.

I want to calculate flat colors complexity, many lines complexity, good light complexity and if there are any other complexities all of them. With having all kind of image complexities I will sort my images and decide which one fits best to my aim.

So why do I need? When I resize them with ImageMagick, I will apply filters based on image's complexity such as unsharp option

It makes huge difference in borders' aliasing

I want to calculate complexity of images in C#

I am willing to use 3rd party libraries, etc.

Furkan Gözükara
  • 22,964
  • 77
  • 205
  • 342

1 Answers1

1

People often use entropy as a measure of scene complexity. With libvips, take the histogram and compute entropy from that:

$ vips hist_find chicken.png x.v
$ vips hist_entropy x.v
5.048871
$ vips hist_find dino.jpg x.v
$ vips hist_entropy x.v
7.574827

You can see your dino image is much higher. libvips has a nice C# binding on nuget --- you'd write something like (untested):

using var im = Image.NewFromFile("image.jpg", access: Enums.Access.Sequential);
double entropy = im.HistFind().HistEntropy();
jcupitt
  • 10,213
  • 2
  • 23
  • 39