-1

I am using the inpainting command in GMIC, which takes in both an image and a mask which indicates which part of that image to inpaint. Values that are 255 on the mask are then filled in.

http://gmic.eu/reference.shtml

The input images I am using have huge black portions (the value of the pixels are 0 here). I want to define the mask to be exactly the pixels of the original image which are black.

Of course, I can preprocess all these masks in matlab, python, etc, but this will take a long time as I am processing on the order of 1 million images. GMIC has a fast piping interface which does everything in memory, and a mathematical interpreter, so I should be able to do this all with the GMIC command line and save a lot of time.

The answer I need does this entirely in GMIC using it's mathematical interpreter. Thanks in advance!

neubert
  • 15,947
  • 24
  • 120
  • 212
user3273422
  • 53
  • 1
  • 6

1 Answers1

3

Something like this probably :

$ gmic input.png --select_color 0,0,0,0 -inpaint[0] [1],.... -keep[0] -o output.png

(where you must set your inpaint parameters according to your needs).

bvalabas
  • 66
  • 1
  • 1
    I get 'Error encountered when calling G'MIC : '*** Error in ./ *** Unknown command or filename '--select_color'.'' Is there any alternate to select_color ? – Akash Goyal Apr 12 '19 at 10:15
  • @AkashGoyal try "-select_color" instead of "--select_color" – tayyab Sep 28 '20 at 04:40