Jump to content
Imaginary

[AP] Refine selection foreground/background issue

Recommended Posts

I came across an issue when refining a selection using the foreground or background brush.

Sometimes there are areas in an image that just can't be processed by the Matte brush completely correct. So then I use the background or foreground brush to tell AP that a particular area definitely belongs to the background or foreground. But as a result those areas are always extended from background into the foreground and vice versa. It seems impossible to determine the correct brush distance from the foreground/background border in order to achieve a clean edge.

I know there is Quick mask mode, where masking works as expected, but it would be much nicer for the workflow to stay inside the refine dialog and immediately be able to correct those areas misinterpreted by AP when using the Matte brush, without making it even worse. 

AP 1.6.2.97 Windows 8.1

Share this post


Link to post
Share on other sites

Hi Imaginary,

Welcome to Affinity Forums :)

After using the Background/Foreground brush to correct the Matte Brush if the selection doesn't match what you want set a smaller brush size (for the Foreground or Background Brush) and pass it over again the background or foreground area to further refine/set them. Since all strokes you paint are then processed by the program there's no need to be very precise. Just make sure you go from a larger to a smaller brush size to get into the details. You can also set the Preview dropdown to Black and White temporarily to help you visualise how clean you edges are. Doesn't this work for you?

Share this post


Link to post
Share on other sites

Hi Miguel,

thanks for your answer.

Well, I have some screenshots to specify my problem:

1. Selection of a horse's head with the selection brush, selection area is about 400x1100 pixels. Refine selection with overlay and in black and white, so far so good:

5a663e7e5b1cd_2018-01-2220_16_29-AffinityPhoto.png.15ebc2678f12c358fe62eaff0ea39896.png5a663e7ee561a_2018-01-2220_17_29-AffinityPhoto.png.04f95f6fca8559abff965a4ff522cd66.png5a663e7ca8b17_2018-01-2220_17_54-AffinityPhoto.png.e7236762d5b76d7d763bc3c145e89d4d.png

 

2. Matte brush over the edges, background detection far from correct, due to bad contrast of the lower head's area to the background

5a663e7d4ff64_2018-01-2220_21_30-AffinityPhoto.png.441b86f3bf03a012d83009eea6c57da1.png

3. After trying to correct the edges using the forgreound (F) or background (B) brush the foreground is bleeding into the background area and vice versa. The brush size was 50 pixels, what is quite small compared to the selection size. The result is worse than before.

BleedingAfterBackgroundForegroundBrush.png.04509a77a73c2f47efd6af02eee74c3a.png

 

Maybe I expect the background/foreground brushes to behave different than they are actually designed to, but when I use those brushes in the context of refining a selection, I want them to correct the selection exactly the way I stroke the brush, I don't need another wrong estimation, what could be background/foreground. That's what we have the matte brush for.

Maybe we could have an option for those brushes to toggle between a straight behaviour like in quick mask mode or the intelligent behaviour (although I can't see the point in this ;) ). The way the fg/bg brushes work at the moment makes them unusable IMHO.

 

Share this post


Link to post
Share on other sites

The Matte, Foreground and Background brushes seem to function OK here.

Maybe that image you have is particularly troublesome for the algorithms used by the Refining process

Any chance you could upload the original?

 

horse2.jpg


Due to the fact that Boris Johnson is now our Prime Minister, punctuation, spelling and grammar will never be worried about ever again.  We now have far bigger problems to be concerned about.

Share this post


Link to post
Share on other sites

Thank you Carl for trying to reproduce my issue.

The image indeed might be difficult due to the lack of contrast particularly in the nostrils' region. But that wouldn't be a problem if I could properly correct the matting results without triggering some new guessing in AP.

I found the image on DeviantArt, you needn't register to download it:

https://aestivall-stock.deviantart.com/art/white-horse-stock-9-150895930

Btw: If you look closely at your image you can see a little red overlay colour on the left eye of your horse, so the matting algorithm decided that this area partially belongs to the background and made it  slightly transparent. And so that is where the foreground brush would come into operation. Would be interesting to see what happens when you stroke the - properly sized - foreground brush over the left eye. If you turn the preview mode to black and white you can see very well whether the foreground is completey correct or not.

 

Share this post


Link to post
Share on other sites

Hi Imaginary

I finally got a chance to play with this a little

It is a difficult image to do and the final results when cut and pasted to another layer/document are not perfect.  But I think the main problem you are having is down to your brush size.

You said  "The brush size was 50 pixels, what is quite small compared to the selection size. The result is worse than before"

I literally had to make my foreground and background brush sizes 2px to get the attached results.

( Even so, that horse's mouth and chin areas are very hard to mask perfectly )

 

Hope that helps

black.jpg


Due to the fact that Boris Johnson is now our Prime Minister, punctuation, spelling and grammar will never be worried about ever again.  We now have far bigger problems to be concerned about.

Share this post


Link to post
Share on other sites

Thanks again, Carl, for fiddling with the settings.

Well, a brush size of 2px(!) is kind of counterintuitive IMHO. It means that the amount of bleeding into the wrong area is strongly dependent on the brush size what shouldn't be the case with the foreground/backgroiund brushes in my opinion. I wouldn't even mind a soft edge of the brushes which would have a smaller corrected area as result, but extending the stroke area in such an unpredictable way is something I consider as a bug.

I am really curious, what the Serif people think about it. Is it a bug or by design?;)    

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

These are the Terms of Use you will be asked to agree to if you join the forum. | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.