BitmapData to Pixel Value , image pixel value
for(var i:int=startPoint.x; i < endPoint.x;i++)
{
for(var j:int=startPoint.y;j<endPoint.y; j++)
{
var pixel:uint = bitmap.bitmapData.getPixel(i,j);
//var alpha:uint = pixel >> 24 & 0xff;
var red:uint = pixel >> 16 & 0xff;
var green:uint = pixel >> 8 & 0xff;
var blue:uint = pixel & 0xff;
var redIntensity:Number = (red / ((green + blue) / 2));
if (redIntensity > 1.8) // 1.5 because it gives the best results
{
// reduce red to the average of blue and green
//bm.SetPixel(i, j, Color.FromArgb((pixel.G + pixel.B) / 2, pixel.G, pixel.B));
var colorTrans:ColorTransform = new ColorTransform(90,green,blue);
//bitmap.bitmapData.setPixel(i,j,uint((green + blue) / 2));
bitmap.bitmapData.setPixel(i,j,colorTrans.color);
}
}
}