Skip to content

Latest commit

 

History

History
10 lines (8 loc) · 787 Bytes

File metadata and controls

10 lines (8 loc) · 787 Bytes

Jump Flood Algorithm

The letters JFA after calculating a distance transform

The jump flood algorithm is used to calculate the distance from a pixel to the closest valid pixel in a source image on the GPU. This repository implements the jump flood algorithm in WebGL, a demo can be seen here, Simply draw some shapes with the mouse and press play to see the steps the algorithm takes, pressing calculate distance transform darkens each pixel based on how far they are from their source pixel.

Dots after JFA forming a Voronoi diagram Using dots as a source image creates a Voronoi diagram.