So, I've got this code:
import flash.display.BitmapData;
import flash.display.Bitmap;
import flash.geom.Rectangle;
import flash.utils.ByteArray;
var bmd:BitmapData = new BitmapData(10, 10, true);
var seed:int = int(Math.random() * int.MAX_VALUE);
bmd.noise(seed);
var bounds:Rectangle = new Rectangle(0, 0, bmd.width, bmd.height);
var pixels:ByteArray = bmd.getPixels(bounds);
Is there a way to get, efficiently and quickly, the dominant color and/or the average color in pixels
ByteArray.
noise
is used for the example here. I'll be having something else drawn on that BitmapData instead.
I found some ways to extract the average color palate from a BitmapData, but this isn't enough for me since I want the average from a rect over that image.
Thanks in advance!