Open-Source Tool for Removing Backgrounds

This just now turned up in my RSS feed (yes, I still use them!), and thought it may be of interest (at least to some): it’s a command-line tool that utilises A.I. to remove backgrounds.

I’ve not had a chance to play about with it myself, but be sure to post your resuts and comments below if you end up giving it a whirl.

1 Like

This looks interesting. I wonder if something like this could be incorporated into GIMP to allow placement of a new background or if the background replacement in the output could be set to transparency. BTW, I thought the image they tested the software on was very challenging due to the similarity in tones of subject and background. So a good result was achieved under challenging conditions.

1 Like

I was thinking the exact same thing. I currently use a small script in GIMP for this purpose, but it’s difficult (and often impossible) to acheive decent results with challenging images. This is certainly one area of image editing that could potentially benefit from A.I. assistance.

There is also rembg GitHub - danielgatis/rembg: Rembg is a tool to remove images background

2 Likes

… which I am using for more than one year and can highly recommend. I am using it for background replacement for portraits shot under bad conditions but with at least a homogeneousish background. It fails in ~5 % at these. However, it makes the cumbersome work of cutting out my son’s soccer team players less than half an hour for 60 photographs instead of several days of manual work. Eventually it also delivers better results than my “manual” work with gimp’s foreground selection tool. For me it works best with alpha mating enabled.

1 Like

Thanks for the tip. After I’ve updated my system (which could take a while as I’ve neglected it a bit — I’ve spent more time than usual with the camera, which isn’t at all a bad thing), I’ll give them both a try.

2 Likes

We use rembg in OpenDroneMap for automated masking. It is beyond stellar.

1 Like

Everything’s installed and ready, but I haven’t had a chance to play around just yet — when I do, I’ll post some comparisons.

At first glance, both apps seem very similar (that is, both draw on the services of U2Net).

I’ve also installed both as Python packages (but using pipx rather than pip).

1 Like