I use ON1 photo 10.5 for its masking abilities. The quick mask brush followed by the refine brush is the best method I have found to remove the background from my stacked macro shots. I find the interface a bit clunky (like the limited, pre-set zoom steps and having to move the view of the image by dragging a frame in a separate window), so it takes some getting used to - and also some playing with the shortcut key assignments to speed things up. But it does this particular job really efficiently and well once you you get the hang of it. I save the result to a .psp file which I can then open in GIMP, maintaining the layers, for the rest of my processing. I have not tried to used ON1 for anything else.
Example:
Argyra leucocephala (Dolichopodidae) from a stack of 46 images, shot using Canon EOS R, MP-E65 macro, approx 3:1, F4, ISO 100:
Here is the stack before masking. I support the specimen on a headless micro-pin which I try not to push all the way through the thorax so that the pin is hidden by the fly's body. The blunt end of this pin then goes into a thin strip of plastazote coloured blue with a highlighter pen. This is not a colour you expect to see in nature - which makes it easier to mask out. The same principle as green or blue screens used in film making. The whole thing is supported several inches over a plain grey background paper - which is well out of focus in all the shots.
Here is the result after masking with ON1. I make sure the refine brush has the "Color decontamination" option ticked to remove the blue fringing around the outline where the plastazote was in the background. The resulting masked fly layer, with a transparent background, can then be placed over whatever background I want - in this case a plain neutal grey - #AAAAAA (which pretty much matches the original background paper I used for these shots).
One of the great things this can do, and I don't know of any other software with this ability, is remove the background colour from the wings - leaving them semi-transparent in the mask. This then allows the preferred background to show through naturally. This is great if you need a white background (for example, if you want to put the resulting image inline in text) - otherwise the wings will look unnaturally dark making it look like a cardboard cutout!