On Sun, Mar 29, 2009 at 8:14 PM, Juan Pablo Califano <[email protected]> wrote: > As it's been said already, you could try converting to HLS and the get the > average luminance (brigthness). Here's a handy class to convert from RGB to > HSL and viceversa. > > http://www.dreaminginflash.com/2007/11/19/hls-to-rgb-rgb-to-hls/ > Another approach, which might be faster (but you'd have to test it to see if > that's true), could be transforming to bitmap to a grey scale. You would > then know how black / white each pixel is, so you could get the average > value by adding the value of each pixel and dividing for the total number of > pixels. Instead of reading the whole pixel value, you can just read one > channel, because since it' s a grey scale, the three color channels will be > equal.
If you're going to test any kind of average pixel value, it'd be far faster to take a bitmap copy of the frame scaled to 1 pixel x 1 pixel (with smoothing on) - and just read the colour value of that pixel... HTH, Ian _______________________________________________ Flashcoders mailing list [email protected] http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

