1

I know that several of these values can be derived through photoshop, but it seems like it would need to be done manually for each image file.

What I'm interested in is a resource that I can give several image files (~300) and get measures of things like mean luminance, colour balance etc., in an automated fashion.

As a followup, you can maybe tell that I don't have a clear vision in mind of which measures I would like to get of the images. I'm curious what is out there? I'm interested in any variables that capture aspects of the image: luminance, symmetry, saturation, colour balance etc. I'd love to hear about any others that you'd recommend. Of course as a caveat, these should be easy to extract, using an automated process like I mentioned.

1
  • As in the average colour of the image? Apr 9, 2016 at 0:33

1 Answer 1

1

ImageMagick should be able to do most if not all of what you need.

ImageMagick is a command-line tool for reading, editing, creating and converting bitmap images.

What measurements you want or need to extract is hard to answer—there are infinitely many ways to measure an image. What is useful for you will depend on your use of those measurements.

You can find general usage examples for ImageMagick here:

Some more relevant examples of extracting image information with ImageMagick can be found here:

A few examples from the ImageMagick Tidbits page:

Average RGB Color of an Image

convert rose: -colorspace rgb -scale 1x1 -format "%[pixel:p{0,0}]" info:

rgb(146,89,80)


Grayscale Minimum, Maximum, Mean And Standard Deviation Of An Imag

data=`convert rose: -colorspace gray -verbose info:`

min=`echo "$data" | sed -n '/^.*[Mm]in:.*[(]\([0-9.]*\).*$/{ s//\1/; p; q; }'`
convert xc: -format "%[fx:100*$min]%%" info:

14.6151%

max=`echo "$data" | sed -n '/^.*[Mm]ax:.*[(]\([0-9.]*\).*$/{ s//\1/; p; q; }'`
convert xc: -format "%[fx:100*$max]%%" info:

100%

mean=`echo "$data" | sed -n '/^.*[Mm]ean:.*[(]\([0-9.]*\).*$/{ s//\1/; p; q; }'`
convert xc: -format "%[fx:100*$mean]%%" info:

41.2302%

std=`echo "$data" | sed -n '/^.*[Ss]tandard.*[(]\([0-9.]*\).*$/{ s//\1/; p; q; }'`
convert xc: -format "%[fx:100*$std]%%" info:

18.581%


Test If Image Has Alpha Channel

[ "$(identify -verbose white.png | grep 'alpha')" = "" ] && echo "alpha off" || echo "alpha on"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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