Free gradient discontinuity and image inpainting