> So is there a fast, efficient way to analyze a 1200 X 800 px
> image to get this average brightness value.
You could try the following function. It is "dirty" (the definition
of 'brightness' is also unsharp!), but it is very fast.
-- uses the average color intensity of the pixel
-- resulting from scaling down to a 1x1 image
function avgBrightness theImage
lock screen; lock messages
if there is no img ii then create img ii
set resizeQuality of img ii to "best"
set width of img ii to the width of img 1
set height of img ii to the height of img 1
set imagedata of img ii to the imagedata of theImage
set width of img ii to 1
set height of img ii to 1
put the imagedata of img ii into iData
delete img ii
return avg (byteToNum(byte 2 of iData), \
byteToNum(byte 3 of iData), \
byteToNum(byte 4 of iData))
unlock screen; unlock messages
use-livecode mailing list
Please visit this url to subscribe, unsubscribe and manage your subscription