Image Warping – Bulge Effect Algorithm

See if I understood what you want. Suppose your image coordinates go from 0 to 1.

If you do:

r = Sqrt[(x - .5)^2 + (y - .5)^2]
a = ArcTan[x - .5, y - .5]
rn = r^2.5/.5 

And then remap your pixels according to:

  x -> rn*Cos[a] + .5 
  y -> rn*Sin[a] + .5  

You get:

enter image description here

You may adjust the parameters to get bigger or smaller bulges.

Edit

Let’s see if I understood your comment about warping. The following images are generated using

rn = r^k {k: 1 ... 2}: 

enter image description here

Leave a Comment