Search code examples
phpimage-processingimagemagickgd

Quickly get brightness / luminosity of images


I'm working in php, and going through each image pixel-by-pixel to get an average brightness for each image is going to be way to cpu intensive...

I've looked through both GD and imagemagick docs, but haven't found a way to return the average brightness of an image... Can this be done quickly either in these libraries, or in another package easily accessible by php?


Solution

  • Here is an interesting post using ImageMagick for computing the average graylevel of an image. This post also discusses Mark Ransom's technique of size reduction to 1x1 using ImageMagick.