Actionscript 3 - PixelMorphing class first test (morphing with particles)

BitmapData, Particles, actionscript 3, classes, morphing

Hi there,
I am back after some pause with this interesting effect. This class takes every pixel from two pictures, sort them by averaged luminosity e reconstruct the second picture animating pixels from the first one.

The effect is a very nice pixel morphing (particles morphing) and the final result resambles some color ramp recolor tecnique.

pixelmorphing_test.jpg
Start demo

This is the second algorythm I wrote. The first one was build to do the calculation about moving pixels and then draw the full picture parsing the full array of pixels. The bigger problem in the first one was speed of execution.

The setPixel method of the BitmapData class is far too slow for this kind of effect and even slower was the parsing every frame of the full array containing all the pixel of the first image.

So I come with completely new algorythm that uses three bitmaps/bitmapdatas where the first only displays original image and set to trasparent only pixels that have moved away.
The scond one redraws every frame, but only displays moving pixels which are stored in a much shorter array and the last one shows only pixels which reached the final position.

With this second approach only pixels effectively changing are redrawn and a lot of speed can be gained.

This first post is only for showcase, during next days I will write a technical post about class structure, speed optimisations etc. off course with source code.

Don’t forget to leave a comment if you like it ;-)

16 Responses

  1. Exey  •  February 15, 2008 @6:44 pm

    Amazing!

  2. Fardeen  •  February 16, 2008 @6:22 pm

    Excellent ! A little long but beautiful effect .

  3. Thomas Joos  •  February 19, 2008 @11:40 am

    I can’t wait to see the source code, could you also put the source code of the equalizer online please? quite a stunning effect!

  4. jouni  •  February 29, 2008 @1:03 pm

    very cool! any way to do this in flash 8 with as2?

  5. oliver_l1  •  March 5, 2008 @8:25 pm

    awesome! good work.show the world the source code…

  6. renovationdoctors  •  April 4, 2008 @8:46 pm

    I can’t wait to see the source code

  7. Dimitar  •  April 7, 2008 @4:31 pm

    It’s amazing

  8. phoenix  •  April 9, 2008 @8:06 am

    Wonderful! yearning for source code!

  9. Ben Ashcroft  •  April 22, 2008 @12:20 pm

    WOw, really impressive. Looking forward to seeing how you did it?

  10. dantesnake  •  May 2, 2008 @12:52 pm

    very cool! good work

  11. gallypette  •  May 27, 2008 @3:20 pm

    Brilliant, any sources ?

  12. mitch  •  August 6, 2008 @3:37 am

    really awesome!!!
    good work!!!

  13. Man  •  August 25, 2008 @1:20 am

    Totally rad :-D

  14. […] Read more | Demo […]

  15. brad  •  September 25, 2008 @9:59 pm

    can you share the source?

  16. […] lot of time passed since I posted my PixelMorphing class experiment. Seemed to me that post passed quite unobserved but then I received a lot of feedback and e-mail […]

Leave a Reply

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>