as3-image-library is a collection of image encoding algorithms. The lib currently supports the encoding process of BitmapData
into PNG and JPEG images with Pixel density (DPI). A bitmap is supplied to the lib and, according to the encoder, a ByteArray
is returned (with the encoded image data).
This lib is useful to create, for instance, drawing apps with custom export settings where the user can choose the type of the output file. If performance becomes a problem, the BitmapData
class can natively compress data since Flash Player 11.3 and AIR 3.3.
Sample
var bmp_data:BitmapData = new BitmapData(500, 500, false, 0xff0000); var png:ByteArray = PNGEncoder.encode(bmp_data, 150);//150 is pixel density in inches (dpi) var jpgEncoder:JPEGEncoder = new JPEGEncoder() var jpg:ByteArray = jpgEncoder.encode(bitmap.bitmapData, 300);
RT @as3gamegears: New: as3-image-library (collection of image encoding algorithms) http://t.co/pbJuiKQoj6 #as3 #flash #gamedev
@as3gamegears now it’s native see http://t.co/vpR6eyk6es