Ripple-distorted Images

I made a water ripple effects on top of an image based on Shiffman's 2D ripple tutorial. The basic idea to apply the black-white ripple effect to an image is to apply this matrix as a filter to process the image pixels. It is definitely the less-optimal way to do this in which shader does the job way much faster. However, it's a good practice to learn the core ideas of CA. The core modification of the code is attached below. See the ripple shader in comparison in this blog.

Demo is here (Drag/click your mouse to trigger ripples). Source code is hosted on p5 editor.

Ripple distortion on famous Mondrian painting