During my vacation I had little time but at least I was able to do a comparison of the inpainting methods provided by G’MIC. I did not optimize the parameters but used the default configuration, except for -inpaint_diffusion
, where I used the parameter given by @garagecoder, and one other case, where no default values are available. I compared at two areas of the image, a line scratch segment and a large dot-like scratch. These places can be clearly seen on the used mask:
The command line is the same for all, but the inpainting option (and output file name) was changed of course:
gmic -i raw0003.tif -crop 0%,0%,30%,30% -sh 0,2 -sh.. 3 -lt. 82% -erode. 3 -dilate. 5 -inpaint.. [-1] -k... -channels 0,2 -o test_.tif,ushort
The results, upscaled without interpolation, clearly show a “winner” algorithm . First the results:
Numbering the upper results 1 to 3 from left to right and the lower ones 4 to 6, I think in both cases 6 is the winner and 5 on the second place, but with quite some distance. The others are almost equally bad. The main problem is IMHO that the other algos tend to shift/stretch outer values towards the mask center, which leaves a visible artefact in form of “columns” for the line and a “cone” for the dot-like scratch. I guess you already know which class the winner algos are belonging to, the used command for the 6 cases are:
-inpaint
-inpaint_diffusion
-inpaint_flow
-inpaint_morpho
-inpaint.. [-1],5,15,0.5,1,9,0
-inpaint_patchmatch