Inpaint on the command line

When dealing with 16bits images, some care must be taken.
As the image values are in [0,65535], this usually has a strong influence on the algorithm parameters. I believe it does make a difference for the inpainting algorithm. It’s usually a good idea to first divide your image values by 257, apply the algorithm with the parameters you have for 8bits images, then multiply the result by 257 afterwards.
Note that you won’t loose any precision as G’MIC internally stores images with float-valued buffers.

Also note that if you output a tiff with G’MIC, it will output a float-valued tiff file, which is unfortunately not often supported by other programs. So it is a good idea to force the output to be in unsigned short mode, like this :

$ gmic -i input_16bits.tiff -div 257 ... put the inpainting commands here ... -mul 257 -cut 0,65535 -o output_16bits.tiff,ushort

Concerning the color profile, I believe this has to do with the exif info ? Maybe this thread could help ?