There is still one option that uses a weighted grayLevel-mean
(I use these weights in imageJIT). This would reflect more
than simple averaging that one wants a dark/light decision.

return (0.1*byteToNum(byte 2 of iData) \
      + 0.6*byteToNum(byte 3 of iData) \
      + 0.3*byteToNum(byte 4 of iData))

Also, what will be still fast enough, you could think about 
scaling down _proportional_ to 3x2 pixels (or 12x8 pixels)
and then applying the above weighted mean on these few pixels.

p.s. I checked: The one-pixel color is by LC built from the
arithmetic mean of the color channels, nearly as fast as an external!

use-livecode mailing list
Please visit this url to subscribe, unsubscribe and manage your subscription 

Reply via email to