O'Reilly logo

HTML5 Web Application Development By Example Beginner's guide by J.M. Gustafson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Image distortion

Next we will add a more advanced effect. We will take the image and distort it with waves to make it look like a reflection in the water. We can do this using the Math.sin() method to offset the pixel positions from their original positions in a wavy pattern. So instead of changing color channels, this time we will be moving pixels around.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required