salty hn post (split from Ai masking post)

It would be strange if the majority of people posting here were not enthusiasts! But hey…

I find darktable mostly enjoyable and soothing to the mind. As a result, I spend a lot longer on each picture. With GIMP, I do production-line mode and minor-tweak jpegs quite quickly. That’s just me: I’m sure there is no reason that one can’t use dt in production mode. Pasting edits to similar pictures is a good start.

I also find that stuff that I have found very difficult in other software seems to be easy in dt. Masking, at least at the basic to middling levels, is just so easy to do. I’m still a bit baffled by some of the more advanced inclusion/exclusion stuff (Yes, I know: there’s a great video. One of Boris’s I think) and I have not begun on blend modes. I like that life and learning does not stop with a few sliders and a magic-wand button!

It is a bit sad that, when mentioning dt on DPReview to someone seeking a LR alternative, the suggestion is barely acknowledged. The person will probably install free-demo copies of several packages. Surely dt (or rt) is also worth an hour or three of their time? Especially as the “free demo” never expires :joy:

one has to try not to look like a FOSS Warrior! Which I’m not, anyway. I don’t have any personal barriers to closed, paid software. I have one criterion which I don’t want to change: Linux, not Mac or MS. And I’m not even trying to force that on anybody: if they are happy with Windows, let them keep it. It’s just that… <sigh!>

/my-2c-rant :wink:

2 Likes

Sure (here, as there’s not too much to say as everything is very simple and straight forward).

I had many times the task to shoot player portraitsof the soccer players of my son’s soccer team. For this, there’s not much time as it has to happen before the training starts (to not have red heads), and this is typically not a good portrait light, typically harsh afternoon sun, not from above as at noon, but also not yet golden hour. I don’t own flashes that could overpower the sun, so I am shooting against the sun, using a reflector to get some light onto the children. I am using a foldable backdrop in black or white, depending on the actual light situation.

The problem is that some light shines through the backdrop and I cannot get it pitch black, nor pure white. There’s always some structure left, but not a nice one. And often enough, the team needs a white background when I did the portraits on black, or the other way 'round.

So, the task for me is to separate the players from the backdrop and add a new background, either some nicely structured black or white, maybe with some radial luminance gradient, and I also did trading cards with other backgrounds in the past.

I tried the foreground select tool from gimp, but this is orders of magnitudes too slow for processing 30 to 50 pictures. In the beginning, I used the powerful masking features of darktable, but I was never able to get the hair right (it is a multinational team with all kinds of hair structure, length, color and style).

Rembg solves this issue in a simple way. Rembg autodetects the foreground, which is simple in this case but at least I don’t have to draw even the coarse outlines. The drawback is that in about 1 of 20 cases, rembg leaves some inner “holes” e.g. between arm and body if the hand touches the body, which I then simply eliminate with darktables masking afterwards.

Then, rembg uses the pymatting library to compute an alpha mask when applying the -a flag, which does most of the “magic”. pymatting implements several techniques to compute accurate alpha masks from a black-grey-white mask (the same that gimps foreground selection tool uses), and the black-grey-white mask is provided by rembg. If I understand the source code of rembg good enough, it only applies one (“multi level”) of the many foreground estimation and one (“closed form”) of the alpha computation methods provided.

All the work is done on the command line with the commands provided on the rembg readme: GitHub - danielgatis/rembg: Rembg is a tool to remove images background.

3 Likes

Totally agree with this.

1 Like

Personally I have held off upgrading the camera until I was sure that the format (CR3) was usable with FOSS tools.

1 Like

Seen many times: user edits images, saves image, computer crashes, file is lost/corrupted. If he was using PS, it’s Windows’ (or the hardware’s) fault. If he is using Gimp, it’s Gimp’s fault. Same if the SD card is faulty, etc…

1 Like