Trying to get a file's average brightness level
Posted: 2013-09-10T16:04:44-07:00
The documentation isn't clear what this output actually calculates:
identify -format "%[mean]\n" filename
It sounds like it should be similar to the "Mean" values that come out of (the middle of) this command:
identify -verbose filename
But they aren't alike at all. Why are these statistics different when they have the same name?
The real underlying problem that I'm trying to solve is I want a computationally quick way to determine a "level of brightness" of a given file. And I have to do this at least 100 times per second. I find that piping the results of "identify -version" into awk to extract the mean intensity level is unable to meet my speed requirements. I was hoping that this "format" method might be faster. It might help if there was a built-in way to limit the output values of the "identify -verbose" command, but I can't find a way to do that.
Don
Version: ImageMagick 6.8.6-3 2013-06-25 Q16 http://www.imagemagick.org
identify -format "%[mean]\n" filename
It sounds like it should be similar to the "Mean" values that come out of (the middle of) this command:
identify -verbose filename
But they aren't alike at all. Why are these statistics different when they have the same name?
The real underlying problem that I'm trying to solve is I want a computationally quick way to determine a "level of brightness" of a given file. And I have to do this at least 100 times per second. I find that piping the results of "identify -version" into awk to extract the mean intensity level is unable to meet my speed requirements. I was hoping that this "format" method might be faster. It might help if there was a built-in way to limit the output values of the "identify -verbose" command, but I can't find a way to do that.
Don
Version: ImageMagick 6.8.6-3 2013-06-25 Q16 http://www.imagemagick.org