Compact finite-difference approximations for anisotropic image smoothing and painting