I'm writing a small libGdx
application that may be able to distort a face simulating hits (something similar to FaceSmash
), but can't find what kind of filter should I apply, neither info about math algorithms to achieve something like a bulge effect.
I've started from SphereFilter on
but definitely the effect is not what I'm looking for.
I'm aware of
Image Warping - Bulge Effect Algorithm
and
How to warp images in Android?
I've achieved to 'translate' the bulge effect mentioned on the first thread, but is relatively slow, and can't find the way to create bulges in a region, not the whole image.
The warp sample on Api demos
(2nd thread) is really fast, and changes only part of the image, but is not exactly a bulge effect, and my image processing maths are far from understanding how could I modify the algorithm to change the effect.
I can feel I'm in the right direction, but I'm totally stuck. Any idea of how any of these algorithms could be modified in order to get 'local' bulges inside the image?
EDIT
Just found this thread.-
How can you apply distortions to a UIImage using OpenGL ES?
Not android, but looks promising. I'll give a try to OpenGL shaders and share (hopefully) a solution for my scenario.