politician Posted July 11, 2011 Share Posted July 11, 2011 I have a few questions about plugins and their ability to interact with layers. First, suppose I have an image with 2 layers where the top layer is transparent and the bottom layer is some image. When I run a plugin with the top layer selected, will I be able to read the pixels from the bottom layer? Or will I see the blended pixels from both layers? When I write pixels back, am I writing to the top layer? Second, can my plugin create new layers by itself? Or is that something the user will have to do? For example, can I build a plugin that reads the RGB values of an image and then write the red channel to a new layer so that when the effect ends the user can flip between the original layer and the new "red" layer? Thanks, Quote Link to comment Share on other sites More sharing options...
pyrochild Posted July 11, 2011 Share Posted July 11, 2011 An Effect plugin can only see the current layer. A FileType plugin has access to every layer, of course. Second, can my plugin create new layers by itself? Or is that something the user will have to do? Plugins can't add new layers to the image, although you can create a temporary Surface to use as a scratch layer. Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
politician Posted July 11, 2011 Author Share Posted July 11, 2011 Thanks for the quick response! That's too bad about Effects plugins, but I certainly understand how it simplifies the implementation. I don't think FileType plugins will be suitable for what I'd like to do since I believe they are for exporting into alternate file formats, correct? It sounds like my example scenario is not possible. Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted July 11, 2011 Share Posted July 11, 2011 You could write a plugin that removes everything but red. Open image, duplicate layer, then run plugin on duplicated layer. Presto! Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
politician Posted July 11, 2011 Author Share Posted July 11, 2011 You could write a plugin that removes everything but red. Open image, duplicate layer, then run plugin on duplicated layer. Presto! That's brilliant. I was just sitting here thinking that I'd have to build two plugins, one to push the effect to the clipboard/static state and then one to pop it onto a new layer. I'm glad I rechecked the forums... Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted July 11, 2011 Share Posted July 11, 2011 Nonono, always follow the line of least resistance As an experienced slacker I often come up with these time saving methods Here's another one: Search the Plugin Index for a plugin that will do the job for you. I'm not certain there is one there...., but it's worth a look. Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Rick Brewster Posted July 11, 2011 Share Posted July 11, 2011 Also, http://searchpaint.net is invaluable. It's powered by Google, which is better than the forum's built-in search. It will search across the forum and the paint.net documentation. Quote 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 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.