tsjipko Posted October 20, 2007 Share Posted October 20, 2007 Hi people. I suck at coding, so I decided to post a request here and see if one of you smart people is able to come up with the following plugin. What I miss in Paint.NET is the function that is present in other image editing programs: expanding and shrinking of your selection. What this does, is add a specified number of pixels to the border of the selection (adding an 'outline' of the selection to the selection) - "Expand". Or it subtracts the specified number of pixels from the selection border - "Shrink". A very basic version of this function actually is present in the 'move selection' tool of Paint.NET, where you can expand or shrink a selection by carefully dragging the top-left and the bottom-right handles of the selection until you've added the desired amount of pixels to the border of the selection. However, this doesn't work anymore when you're trying to manipulate more complex selections. The best example is a selection with a hole in the middle. By dragging the selection to 'expand' it, as described above, you're actually increasing the size of the hole in the middle of the selection along the way. What an 'expand selection' tool would do, is add pixels to all the borders of the selection, making the hole in the middle smaller. I hope I've described the function clearly and that somebody can actually find the time to implement this in a plugin. Thanks for any responses already: I'm always willing to explain more about what I'm talking about here. Quote Link to comment Share on other sites More sharing options...
aguba Posted October 20, 2007 Share Posted October 20, 2007 This forum is reserved for plugin publishing ONLY Quote aguba.deviantart Link to comment Share on other sites More sharing options...
david.atwell Posted October 20, 2007 Share Posted October 20, 2007 Also, the Paint.NET plugin API is such that tools cannot be made, only effects, adjustments, and filetypes; also, the API only allows a plugin to access the selected area, and said area cannot be increased or decreased. Try creating a new layer, filling the selection you want to expand with a color; then deselect, and use Pyrochild's "Outline Object" plugin to expand it. Magic Wand the outer area, invert the selection, and return to the first layer to do your adjustment. So, in summary: As aguba said, pay attention to the notes atop each forum, and read the rules (or risk having your threads locked by a mod). After that, try my workaround. :-) Hope this helps! Quote The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.Amy: But how did it end up in there?The Doctor: You know fairy tales. A good wizard tricked it.River Song: I hate good wizards in fairy tales; they always turn out to be him. Link to comment Share on other sites More sharing options...
tsjipko Posted October 20, 2007 Author Share Posted October 20, 2007 This forum is reserved for plugin publishing ONLY And hello to you, too! Sorry for misplacing this thread; an honest mistake. And now that it's clear to me that this isn't even feasible as a plugin, it would be nice if a mod could move it over to the GD & Q forum. And with that, this thread can be considered as a feature request for Paint.NET itself and not a plugin request anymore. And thanks for suggesting the outline tool for this. That plugin actually made me think that it would be rather easy to cook up a plugin that could expand a selection. Using the outline plugin actually works for expanding a selection. But it involves a lot of steps - making a new layer, filling a selection, deleting the newly created layer, returning to your original layer - that can be easily avoided if this simple feature would be included in the program. Quote Link to comment Share on other sites More sharing options...
david.atwell Posted October 20, 2007 Share Posted October 20, 2007 And hello to you, too! He didn't mean to sound...well...mean. It's just something that happens so often, we sometimes end up just typing or pasting a very terse reply. And thanks for suggesting the outline tool for this. That plugin actually made me think that it would be rather easy to cook up a plugin that could expand a selection. Sorry, but no. Not with the current Effects API, at least. See, the Outline Objects plugin fills in all the transparent pixels to a certain distance from any non-transparent pixel; it doesn't do anything with selections at all. All an effect plugin can do is work with the selection; not only can it not expand a selection, but it can't even access the pixels outside a selection or on a different layer. I think that workaround is pretty much the only way to do this. Quote The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.Amy: But how did it end up in there?The Doctor: You know fairy tales. A good wizard tricked it.River Song: I hate good wizards in fairy tales; they always turn out to be him. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.