Actionscript 3 - PixelMorphing class first test (morphing with particles)
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.
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 ![]()











































Exey said
am February 15 2008 @ 6:44 pm
Amazing!
Fardeen said
am February 16 2008 @ 6:22 pm
Excellent ! A little long but beautiful effect .
Thomas Joos said
am 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!
jouni said
am February 29 2008 @ 1:03 pm
very cool! any way to do this in flash 8 with as2?
oliver_l1 said
am March 5 2008 @ 8:25 pm
awesome! good work.show the world the source code…
renovationdoctors said
am April 4 2008 @ 8:46 pm
I can’t wait to see the source code
Dimitar said
am April 7 2008 @ 4:31 pm
It’s amazing
phoenix said
am April 9 2008 @ 8:06 am
Wonderful! yearning for source code!
Ben Ashcroft said
am April 22 2008 @ 12:20 pm
WOw, really impressive. Looking forward to seeing how you did it?
dantesnake said
am May 2 2008 @ 12:52 pm
very cool! good work
gallypette said
am May 27 2008 @ 3:20 pm
Brilliant, any sources ?