Is there an automated way for batch processing, using a filter, plug-in, script etc. to just select the largest area in the mask?
If the first image should be clipped and the »frame«-segments were to link up they might turn out to be »bigger« both in height, width and area than the »relevant« part.
A workaround might be to load the selection, invert, expand by X, contract by (X + Y), invert, intersect with the existing Mask.
But there may be issues with the »holes« in the main object.
Maybe you should start with showing the actual images instead of just showing the Masks.
Considering you're working with a mask, so there's no "automated" way for Photoshop to distinguish which particular white parts you want to keep, I can't think of a fully automatic way to select exactly what you want to keep.
If I wanted to automate this, I'd create an action with a pause for interaction at the selection point. Yes, I'd do a manual selection, but it needn't be crazy (at least as far as what you're showing us). I'd say a quick swipe with the magnetic lasso, or quick select (although I'm not a fan of it's soft edges for this kind of work), then continue with inversing the selection and filling with black would be the quickest and most specific way to get the selection you'd want.
Another method - although, again, not completely automated, might be to loose lasso your main object prior to running Select>Color Range. That way, you're restricting what colors'll be picked up in the first place, limiting a lot of the junk that ends up in your resulting mask.
it also smooths the outline of the object you are masking.
That could be addressed by expanding the result and intersecting it with the original.
I have the same question, and an observation: why is it so difficult to accomplish this? Even measly Corel PhotoPaint has had a "remove holes from mask" option for years! But after extensive googling, I can't find a solution or an action to accomplish this. Heck, if Corel can implement this, it can't be impossible. I'm surprised nobody has figured it out and created an action for it. I might even pay for the action!
1 person found this helpful
If you have a CC subscription After Effects has an effect that can do this perfectly. You could load the images in as an image sequence, process them in AE and then output them again as another image sequence.
The effect I'm talking about is Keylight. It's designed for keying green screen footage but has a lot of matte cleanup tools include. The Despot feature of Kelight is designed specifically for this purpose and would work a treat. It allows you to set a threshold and to despot either white or black "spots". Please ask if you need more help with this.
hope this helps,
Angie Taylor | Creative Cabin