Jump to content
IndigoMoon

How to exclude areas for the Inpaint Algorithm?

Recommended Posts

Hi,

sometimes the Inpainting Brush Tool or Fill Inpaint works quiet good for some scenarios,

but unfortunately in some cases absolutely not, especially if greater areas should be replaced with inpainting.

In this cases the algorithem takes parts of the image which makes no sence.

So my idea was to select a greater part of the image excluding the parts which shouldn't be used for the Inpainting alogrithem, in the hope for better results,

but the algorithem still takes parts of the non selected area, or simply said the same result as before without selection.

Any suggestions how to improve the Inpainting, respectively exclude areas for the algorithem?

Thx!

Share this post


Link to post
Share on other sites

I've often achieved good results by simply repeating the inpainting process multiple times, i.e. painting over the incorrectly filled areas again. If you want more control over the sampled parts of the image, use the Patch tool instead. From my experience, convincing results often require the combined use of multiple tools. For example, I'd often do inpainting as a first step and then use the clone brush tool to do the fine tuning.

Share this post


Link to post
Share on other sites

Yes, that's the way I'm doing now as well. But it's always good to start with a good basis. It's funny, in some scenarios PS ist better in some AP. Well perhaps it would be a good idea to switch between several algorithms if available or at least exclude areas.

Share this post


Link to post
Share on other sites

Inpainting algorithms typically look for a mix of structural & textural patterns in variable sized areas surrounding the selection to determine what to fill the selected area with & how to blend in the edges of the filled in area. Because of this, excluding a part of those surrounding areas usually would not work very well since it would likely cause the algorithm to miss patterns needed to produce a good fill & blend.

 

For much the same reason starting with a small selection often produce the best results because nearby areas are more likely to include patterns better suited for the fill. Repeating the process with a larger selection area enclosing the already inpainted one or more often just around its edges can sometimes improve the results. It all depends on the patterns the algorithm has to work with, which is why using a combination of inpainting & the other retouching tools often produces the best results.

 

It is somewhat like the process used by art restorers on physical artwork -- human judgement is a necessary part of it because algorithms can't (yet) "see" things like humans do. But unlike the restorers, working in the digital realm gives us the ability to undo results we don't like very easily. :)


Affinity Photo 1.7.2, Affinity Designer 1.7.2, Affinity Publisher 1.7.2; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.2.153 & Affinity Designer 1.7.2.6 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iOS 12.3.1

Share this post


Link to post
Share on other sites
On 28 October 2017 at 9:24 AM, IndigoMoon said:

So my idea was to select a greater part of the image excluding the parts which shouldn't be used for the Inpainting alogrithem, in the hope for better results,

but the algorithem still takes parts of the non selected area, or simply said the same result as before without selection.

Once you make your selection create a new layer from the selection ( CTRL + J ) then Inpainting on the new layer will not be able to take parts of the non selected area


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
12 minutes ago, carl123 said:

Once you make your selection create a new layer from the selection ( CTRL + J ) then Inpainting on the new layer will not be able to take parts of the non selected area

For that to work as intended, make sure "Current Layer" is chosen in the Context toolbar & not "Current Layer & Below."

 

However, as mentioned above inpainting alone may not get the desired results, & excluding part of the image may make things worse. Experimentation (& when needed, liberal use of undo) is the key to getting the best possible results.


Affinity Photo 1.7.2, Affinity Designer 1.7.2, Affinity Publisher 1.7.2; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.7.2.153 & Affinity Designer 1.7.2.6 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iOS 12.3.1

Share this post


Link to post
Share on other sites
On 29.10.2017 at 10:46 AM, carl123 said:

Once you make your selection create a new layer from the selection ( CTRL + J ) then Inpainting on the new layer will not be able to take parts of the non selected area

How easy it could be ;) Thanks Carl! This is an acceptable workaround. In my case much faster, then apply the inpainting a few times and make corrections using the clone tool...

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

×