Telea Inpainting Algorithm in JS