# AS3: DisplacementMapFilter for image morphing

**URL:** <https://forum.kirupa.com/t/as3-displacementmapfilter-for-image-morphing/304671>\
**Category:** flash\
**Created:** [February 11, 2010, 4:06pm UTC](https://forum.kirupa.com/t/as3-displacementmapfilter-for-image-morphing/304671 "2010-02-11T16:06:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![digits](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@digits](https://forum.kirupa.com/u/digits)\
**Post date:** [February 11, 2010, 4:06pm UTC](https://forum.kirupa.com/t/as3-displacementmapfilter-for-image-morphing/304671/1 "2010-02-11T16:06:53Z")

</div>

Hi guys, it’s been a while…

Recently I have been building an application to manipulate images, and as a part of that I have adapted a class to morph dynamically loaded images.

The problem I am having is that when implementing the displacement class, a small portion of the left side and top of the loaded image get morphed and the image is shifted down and to the right slightly. The original class that I adapted also suffers from the same problem.

I have searched google and various forums for two days in order to better understand [COLOR=blue]DisplacementMapFilter[/COLOR], as well as a part of the class I adapted that uses [COLOR=blue]beginGradientFill[/COLOR] alongside bitwise operators, but I have found nothing that suits my purposes.

I have attached my source.

The original class (that I used as a blueprint) can be found [here](http://www.elctech.com/snippets/actionscript-photo-liquify-smear-distort-with-displacementmapfilter).

Please help! ![](http://forum.kirupa.com/uploads/kirupa/525/d5236136df0858f4.gif)

(also posted on [ActionScript.org](http://ActionScript.org))
