This online demo is optimized for Firefox and fills transparent areas (alpha channel = 0) with free form color gradients from their edges. As input you most likely want to use hard edges (disable antialiasing) to prevent semi transparent pixels from spreading.
GPU-based real-time discrete euclidean distance transforms with precise error bounds
A GPU Laplacian Solver for Diffusion Curves and Poisson Image Editing