AS3 bitmap mosaic class

This class will allow you to create a pixellated copy of any display object.

It allows for varying pixel sizes and caching of rendered pixels so you don’t have to redraw them every time.

mosaic

Usage is as follows:

var myMoz:Mosaic = new Mosaic(yourDisplayObj:DisplayObject, pixelSize:uint, useCache:Boolean);
addChild(myMoz);

or

var myMoz:Mosaic = new Mosaic(yourDisplayObj);
myMoz.pixelSize = 10;
myMoz.render();

Give it a try and let me know what you think.

Tags: , , ,

5 Responses to “AS3 bitmap mosaic class”

  1. Actionscript Classes » Bitmap Mosaic Says:

    [...] http://juliankussman.com/blog/2008/10/01/as3-bitmap-mosaic-class/. [...]

  2. Ian Says:

    Very cool

  3. combinecreative.com » Blog Archive » AS3 bitmap mosaic class Says:

    [...] http://juliankussman.com/blog/2008/10/01/as3-bitmap-mosaic-class/ [...]

  4. Ced Says:

    Hello,

    Nice job but i have a problem trying to use it in Full Browser. I put a mosaic image in background (full browser), and the image is supposed to resize when i resize my window. It works well but the mosaic image sometimes draw horizontal and vertcal outlines around the mosaics…

    Is it normal ? Is it possible to fix it ?

    Thank You !

    Cédric from Montreal…

    [Cedric, your stage scale mode is probably set to EXACT_FIT which is the default. To fix this you should set it to NO_SCALE. Of course after doing that you'd need to listen for a RESIZE event from the Stage and do all your other element's resizing manually through code. Hope this helps - JK]

  5. Jarne Says:

    hey there!
    I’m trying to use this class but I get this error:

    Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.

    Any help?
    Cheers!

Leave a Reply