The following code inverts the colors of an image and returns the inverted image as an Image object. As parameter it needs the container of the image (a canvas).
private function invertImageColor(canvas:Canvas):Image
{
var newImage:Image = new Image();
newImage.source = Image(
[...]