Ripple Image Distortions Effect UV translation algorithm, in PHP or C-style language, similar to the one in The GIMP

StackOverflow https://stackoverflow.com/questions/4481704

Pergunta

I've been working on a UV to XY coordinate space translation algorithm for applying image distortions based on simple equations, in PHP.

My algorithm uses four point bi linear interpolation.

And calculates the position in the original XY space for every point in the UV space.

I've tried to get a Ripple effect like the one seen in The GIMP. I used the translations x = u+2*sin(u/5), and y = v+2*sin(v/5).

however instead of a smooth ripple effect as seen when using the gimp, I get a highly blurred effect (must more than I expected to get).

Can any one point me towards a better way to achieve this effect.

Or free easy to follow preexisting algorithms in either PHP or another language with C-like syntax.

So far all I've been able to with with Google is ready made algorithms that are part of a library that for sale.

Foi útil?

Solução

I've tried to get a Ripple effect like the one seen in The GIMP. I used the translations x = u+2*sin(u/5), and y = v+2*sin(v/5).

I needed to use x = u+2*sin(v/5), and y = v+2*sin(u/5) to get the expected effect.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top