Actionscript 3: How to remove all black pixels from BitmapData ?

Posted by Adnan Doric on Stack Overflow See other posts from Stack Overflow or by Adnan Doric
Published on 2010-04-19T12:01:20Z Indexed on 2010/04/19 12:03 UTC
Read the original article Hit count: 322

Filed under:
|

Hello,

Let say I have a BitmapData with different pixels representing an object, and some black pixels around it that I want to remove.

I would like to obtain a new BitmapData, with width and height of the object represented by non-black pixels.

For example, let say I have a BitmapData 400x400px, but the object represented by non-black pixels occupies the rect: x=100, y=100, width=200, height=200. I want to get new BitmapData representing that rect, all black pixels should be removed.

Any idea on how to do this please ?

© Stack Overflow or respective owner

Related posts about actionscript-3

Related posts about bitmapdata