Jump to content

Tool plugins?

Recommended Posts


This question is mainly for rick, but i guess if anyone has informations it's ok. :D

I've long thought about the limitation of effect plugins.

I think, the actual system is pretty good when it's all about applying a function to a picture.

But there's a whole kind of things that require interactivity that don't belong to that category, as it's not just about setting some parameters.

In this category, i've seen pyrochild's smudge plugin, and there are probably others existing, and even more which could be created.

I can't stop thinking that such plugins would be better as tools, rather than open a new plugin window with the picture and let you edit the picture in this plugin window.

Another case would be a very simple inpainting technique i read about. It requires the users to draw 3 masks on the picture, then it can do it's job. (picture attached)

I think it would be best as a tool, like you select the tool, then you can choose some mode in the tool's toolbar and work with it.

So I wanted to know if you had any plan to support some kind of tool plugin, in PDN 4?


Link to comment
Share on other sites

You're not the first person to request this and Smudge, Splatter and CustomBrushesMini would probably have been created earlier if it was possible to extend PDN in such a way. The Paint.NET roadmap mentions a better plugin system for v4.0, but that's a long way off and from what i've heard, plans for a new plugin system aren't exactly clear.

Is your example a plugin you want to write yourself but don't want to implement a canvas window or just something you'd hope to see if there was a better system?

Link to comment
Share on other sites

I could implement it.

It's a pretty simple technique actually.

Pretty impressive if you consider the complexity/quality ratio.

Using a fourrier transform, you get the phase/magnitude of the prototype window (blue mask) and of the repair window

You keep the phase of your repair windows as is, and for magnitude you take the min of prototype and repair windows.

Then you do the inverse transform to go back to spatial domain.

And you keep the new pixel values only where your black mask is.

And then you start again.

Progressively, the texture replaces the black mask.

The papers are here:

http://citeseerx.ist.psu.edu/viewdoc/su ... .1.56.3169

http://citeseerx.ist.psu.edu/viewdoc/su ... .1.53.5591

Don't let the wording fool you. They talk about projection onto convex sets, but it's really just intellectual masturbation...

For the the fourrier transforms there are libs.

This one looks nice: http://www.fftw.org/

Link to comment
Share on other sites

Tool plugins aren't currently possible.

A big theme for PDN 4, however, is extensibility. Not promising tool plugins necessarily -- it's still a long ways out.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html


Link to comment
Share on other sites

I saw an FFT-based technique like that in an "image processing cookbook" that I found somewhere. It was intended for removing noise, by presenting the power spectrum as a canvas and allowing the user to zero out parts of it. Pretty cool.

If you're interested in developing a simple inpainting plugin, you might start with a method due to Efros and Leung (c. 1999?) that resamples small texels. It's pretty slow, but it's simple, and yields excellent results for small gaps in my experience. I think one of the authors has a fairly comprehensive website about the method, including papers and links to related research. The only really heavy artillery you'd need would be a way to sample from a Gaussian distribution, but there are plenty of relatively easy ways to do that, particularly http://en.wikipedia.org/wiki/Box-Muller_transform.

I was going to do something like this, but I had already worked with the Efros-Leung technique in the past, and wanted to try something different. I eventually gave up on the idea mostly because any conceivable interface would be tough to either develop or use.

Segment Image : Average Color (HSL) : Eigen Blur : []

Cool, new forum!

Link to comment
Share on other sites

These techniques are really interesting! I hadn't read the papers before.

Sometimes I manually inpaint simple things by selecting the void, filling it with the average color of some small surrounding region, and then running a small-radius Gaussian blur over the void iteratively until it seems to have converged. This is roughly equivalent to solving the Laplace equation over that region with Dirichlet boundary conditions... it ensures that the levels are smooth over the inpainted region, but the solution doesn't really respect what's "going on" at the boundary. *

That's about all I can remember about partial differential equations, so understanding the one described in the first paper is a little tough. The most I can figure out is that, since the image will be constant at the steady-state solution (∂I/∂t = 0), the gradient of the Laplacian of the solution will be orthogonal (dot product of the two terms = 0) to the isophotes (curves of equal luminance). So the Laplacian of the intensity surface will be constant along the isophotes... but I'm having a tough time determining what exactly this means in terms of how it determines the structure of the final image... best guess is that it enforces constant "sharpness" along the isophotes, so that a crisp edge doesn't fade into a soft one or something.

* Incidentally, it also happens to be one of the obscure cases where differences between "true" and "triangular" Gaussian blurs become apparent!

Segment Image : Average Color (HSL) : Eigen Blur : []

Cool, new forum!

Link to comment
Share on other sites

I think i somewhat understand the second paper.

you have the L in HSL and the H and S only on some part of the picture

1) you take the gradients out of the L layer

2) then you fill out the blanks on other layers such that: everything is smooth, and the gradients on these layers are as close as possible as those on the L layers.

I don't know if i missed something in the big picture.

I don't think i could implement that one though.

I understand nothing about partial differential equations, "poisson" is only the french for "fish" for me, and i can't imagine a fish equation or a fish solver! lol :roll:

Link to comment
Share on other sites

Yeah, that's pretty much the idea, but (from memory) I think it attempts to ensure that the Laplacian matches up between the luma and chroma channels, rather than the gradient. And it uses YCbCr, which is a very popular linear color space - SDTV, HDTV, JPEG, and probably tons of other things use it, mostly because it facilitates downsampling of color information while leaving intensity information roughly unchanged.

Segment Image : Average Color (HSL) : Eigen Blur : []

Cool, new forum!

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.

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...