The physics simulation is computed on the CPU (Box2D) and the blurring and thresholding is handled by the GPU using WebGL.
See the Git repository for full source code listing. The original idea came from here: How to simulate liquid .