Jump to content
How to Install Plugins ×

Content Aware Fill (2023-04-30)


null54

Recommended Posts

OMG!  ? This is AWESOME!! I couldn't believe how good this is.

 

To try it out, I cut a circle out of a reasonably complex scene. The two different replacements were created with different settings. Both are very believable!

 

content_aware_fill_demo.jpg

 

Thanks so much @null54. This definitely goes into my "essentials" toolbox.

Link to comment
Share on other sites

Excellent Plugin @null54 - Thank you.  I played with it and discovered that if one increases the Tolerance slightly, there will be no 'ring' left behind :star:

30b8T8B.gif

How I made Jennifer & Halle in Paint.net

My Gallery | My Deviant Art

"Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon.

 
Link to comment
Share on other sites

I just tried this on one of my shapes pictures.  With the proper settings, I  couldn't even tell where I made the selection!

 

Excellent!  Thanks,  @null54   :star:

  • Upvote 1
Link to comment
Share on other sites

I managed to get an error that crashes PDN. Seems to occur for selections that include pixels along the bottom of the image; I didn't test other sides. It's an index out-of-range error. Details:

Spoiler

File: C:\Program Files\paint.net\Effects\ContentAwareFill.dll
      Name: ContentAwareFill.ContentAwareFillEffect
      Version: 1.0.0.0
      Author: null54
      Copyright: Copyright © 2018 Nicholas Hayes (aka null54)
      Website: https://www.getpaint.net/redirect/plugins.html
      Full error message: PaintDotNet.WorkerThreadException: Worker thread threw an exception ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at ContentAwareFill.Resynthesizer.PrepareNeighbors(Point position)
   at ContentAwareFill.Resynthesizer.Synthesize(Int32 pass, Func`1 abortCallback)
   at ContentAwareFill.Resynthesizer.ContentAwareFill(Func`1 abortCallback)
   at ContentAwareFill.ContentAwareFillEffect.OnSetRenderInfo(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs)
   at PaintDotNet.Effects.BackgroundEffectRenderer.ThreadFunction() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 227
   --- End of inner exception stack trace ---
   at PaintDotNet.Effects.BackgroundEffectRenderer.DrainExceptions() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 418
   at PaintDotNet.Menus.EffectMenuBase.DoEffect(Effect effect, EffectConfigToken token, PdnRegion selectedRegion, PdnRegion regionToRender, IRenderer`1 clipMaskRenderer, Surface originalSurface, Exception& exception) in D:\src\pdn\src\PaintDotNet\Menus\EffectMenuBase.cs:line 1556

 

Edited by Joshua Lamusga
Link to comment
Share on other sites

2 hours ago, Joshua Lamusga said:

I managed to get an error that crashes PDN. Seems to occur for selections that include pixels along the bottom of the image; I didn't test other sides. It's an index out-of-range error.

 

That crash and the dialog tab order have been fixed in version 1.1.

 

 

  • Upvote 1

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

Interesting. Did you release v1.1 in response, or did you upload it within the last two hours? I suspect if your answer is no, then I was served an older version.

Link to comment
Share on other sites

12 minutes ago, Joshua Lamusga said:

Did you release v1.1 in response, or did you upload it within the last two hours?

 

It was released in response.

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

Fixed the Paint.NET Dark theme support and improved performance.

File version updated to 1.2.0.0.

  • Like 1

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

40 minutes ago, Zevel said:

Can you move the menu entry from "Photo" to "Selection"?

 

Done.

 

Changed the submenu from "Photo" to "Selection" and updated the PluginSupportInfo to point to the forum thread.

File version updated to 1.2.1.0.

 

 

  • Like 4
  • Upvote 1

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

5 hours ago, Zevel said:

Can you move the menu entry from "Photo" to "Selection"?

 

 

I don't actually think this is a good idea.

 

All plugins work on selections.  But, the plugins in the selection submenu change their behavior based on the shape of the selection.*

 

This plugin doesn't do that.

 

I'd put it back in the photo menu as I think it is really designed for repairing photos.

 

 

 

*For example, outline selection draws an outline in the shape of the selection.

  • Upvote 1
Link to comment
Share on other sites

I think either Photo or Selection makes sense. This plugin depends on the selection in a way most plugins don't. In most plugins, the same thing occurs in the selected area as would occur if there were no selections at all. The selection merely restricts the region that's affected. In this plugin, the results are determined by the pixels on the selection boundary.

  • Upvote 1
Link to comment
Share on other sites

I agree with MJW on this one.  The plugin requires a selection, and I don't see much of a difference between it's positioning and the "feather selection" one.

My vote is for selection.

 

Edited by alexo
Link to comment
Share on other sites

I originally placed the plugin on the Photo menu because that was the location of BoltBait's Seam Carving plugin, which was the closest existing "content aware" plugin.

The purpose of this plugin is to replace the contents of a selection based on the pixels outside the selection.

Which as @Ego Eram Reputo's example above illustrates is useful for more than just photographs.

 

13 hours ago, BoltBait said:

All plugins work on selections. 

 

But as @MJW has noted most plugins do not require a selection to operate, and there are not many other categories to make that requirement clear to users.

PdnSig.png

Plugin Pack | PSFilterPdn | Content Aware Fill | G'MICPaint Shop Pro Filetype | RAW Filetype | WebP Filetype

The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait

 

Link to comment
Share on other sites

19 minutes ago, null54 said:

@Ego Eram Reputo@MJWI originally placed the plugin on the Photo menu because that was the location of BoltBait's Seam Carving plugin, which was the closest existing "content aware" plugin.

Which ironically does not work with selections.

 

Link to comment
Share on other sites

  • 1 month later...

I recently switched over from PS to Paint.Net and I've been trying to get this content aware plugin to work. I'm not expecting the exact same results as PS, but I can't even come close...

 

I've been trying to remove the woman in the attached image as a test for the plugin and it's been horrendous results. Any tips? I'm using default plugin settings when when the selection > content aware window pops up.

sitting-on-stone-bench-by-water.jpg

Link to comment
Share on other sites

1. Don't trust the defaults. The tiniest change in the sample size can have a big effect on the outcome, as does the selection itself.

 

The first try I had with your image used a sample size of 15. Redoing the selection + 15 looked awful. I had better results with 67.

 

2. Don't remove the object first. Take our time and select around it with care. Then run the plugin directly on the selected lady.

 

Your object in the image is taller than it is wide, so I'd select the refill from the sides. This will take the refill pixels from more horizontal offsets than vertical.

 

I tend to use Inwards fill. It just seems to be better at object removal.

 

So, try something like these settings:

 

Objectremoval.jpg

 

 

In saying that, I don't think you're going to get a seamless result out of the box. You're going to have to do some manual fixing.

  • Like 2
Link to comment
Share on other sites

Hi @Syn

Welcome to the Forum.

A fairly new plugin - but I believe I am getting the hang of it.

THe first step is to remove the area you need filled.

Then work with small areas to fill with the content you are looking for.

Just 15 minutes and I managed to provide this quick example.

vQlaTx.gif

 

More time spent will produce a better result. I should mention a directional blur was added to blend the colors better after the content aware fill.

I am sure this will get you pointed in the right direction. Any questions just ask.

@Ego Eram Reputo is much faster than I ?

 

 

  • Like 2

PaintNetSignature.png.6bca4e07f5d738b2436f83d0ce1b876f.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...