Gerda Twin – getting PS Liquify to Flash

Displacement map filter is a nice but hardly ever used flash feature. Sure it tends to be a bit CPU nasty, but the other problem is that getting a useful map other than a perlin noise or simple lens is a bit of pain in the back. I was getting down to writing a simple displacement editor in Flash, when I realized that Photoshop Liquify tool works very similar and it even allows you to save the output in a binary mesh file (.msh).

Now the only problem was making sense of the .msh format, which after a bit of toying with different simple meshes and peeping into hex editor turned out to be a rather simple array of x,y displacement values arranged row by row. ith this knowledge I was able to load msh into flash and generate BitmapData which I could use as input for DisplacementMapFilter.

Below is a simple practical joke using directly the .msh file and Gerda for demonstration purposes. It’s not very practical because .msh gets rather big fast (1,8 MB here). For real tasks it’s better to printscreen the bitmap and save it as a png for later use. Anyway, move your mouse to the center to see the original picture. In the lower right corner you’ll find the original Liquify effect and everywhere else the combination of different x, y scaling of the filter.

Click on image to open example (almost 2MB – may take a while ):

In the source files you’ll find a MSHLoader class, which loads .msh and converts it into bitmapdata. The usage should be mostly self-explanatory. The ‘scaling’ property is the value you put into scaleX nad scaleY properties of DisplacementMapFilter to get the deformation identical to the one in Photoshop. The componentX and componentY paramters in loadMSH () method are the 1, 2, 4, 8 color channel codes (they MUST be different for both channels) set to red and green by default. They work exactly as componentX, componentY parameters in the filter.


  1. Posted December 4, 2013 at 20:13 | Permalink

    Awesome blog design! What is it called?

  2. Posted December 22, 2014 at 15:57 | Permalink

    We hear how important getting your daily dose of vitamin and mineral rich fruits and vegetables are for proper body functioning and overall health.

    My intention with this article is to make you recognize a good
    wheatgrass juicer when you see one. You might think
    that taking the time to juice your own fruit is time consuming and

  3. Posted December 22, 2014 at 23:20 | Permalink

    In this the fruit and vegetables are first ground and then the juice is forwarded with
    the help of a strainer which revolves at a very high rpm.
    Most high functioning juicers will cost somewhere in the range of $200 to $2,000.
    Families probably want to consider a larger juicer.

  4. Posted December 24, 2014 at 01:24 | Permalink

    The Breville BJE510XL is chiefly made of three main pieces that can be put together
    with remarkably little effort. All of the parts
    are easily removed and are made of an easy-to-clean material.
    Very few models come close to the efficiency of this one and even if they do,
    they don’t seem to last as long or produce as much juice.

  5. Posted March 12, 2017 at 23:19 | Permalink

    If some one wants to be updated with hottest
    technologies afterward he must be pay a visit this site and be up to date all the time.

Post a Comment

Your email is never shared. Required fields are marked *