BoltBait Posted October 15, 2012 Share Posted October 15, 2012 So, I was scanning a ton of photographs today and kept having to do the same steps to remove dust from the images. I automated it into a plugin. Enjoy. // Name: Remove Dust // Submenu: Photo // Title: BoltBait's Remove Dust v4.0 // Author: BoltBait // URL: http://BoltBait.com/pdn // Desc: Remove dust from scanned photographs // KeyWords: dust|stamp|scan|clone #region UICode byte Amount1 = 0; // [1] Dust Color|White|Black #endregion // Setup for using Lighten blend op private BinaryPixelOp lightenOp = LayerBlendModeUtil.CreateCompositionOp(LayerBlendMode.Lighten); // Setup for using Darken blend op private BinaryPixelOp darkenOp = LayerBlendModeUtil.CreateCompositionOp(LayerBlendMode.Darken); // Here is the main render loop function unsafe void Render(Surface dst, Surface src, Rectangle rect) { for (int y = rect.Top; y < rect.Bottom; y++) { if (IsCancelRequested) return; ColorBgra* prevPtr = src.GetPointAddressUnchecked(rect.Left, y); ColorBgra* srcPtr = src.GetPointAddressUnchecked(rect.Left, y); ColorBgra* dstPtr = dst.GetPointAddressUnchecked(rect.Left, y); for (int x = rect.Left; x < rect.Right; x++) { ColorBgra CurrentPixel; if (Amount1 == 0) { // Remove white dust CurrentPixel = darkenOp.Apply(*prevPtr, *srcPtr); } else { // Remove black dust CurrentPixel = lightenOp.Apply(*prevPtr, *srcPtr); } *dstPtr = CurrentPixel; prevPtr = srcPtr; srcPtr++; dstPtr++; } } } There is no UI. Just run it and the white dust specks are gone. There is now a simple UI. Select White or Black and those color specks are gone! It's not perfect. It only works on very small specks. Basically what it does is Clone Stamp them out. Install the dll in the normal way. Then, restart Paint.NET and look in Effects > Photo > Remove Dust for the effect. Download Here For Paint.NET 3.5.11: RemoveDust.zip For Paint.NET 4.0+: https://forums.getpaint.net/topic/113220-b I'm thinking "Plugin of the Year". Yes? 5 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
minners71 Posted October 15, 2012 Share Posted October 15, 2012 Well done you get my vote Must feel good to have a problem like that and just be able to knock out a plugin 1 Quote Link to comment Share on other sites More sharing options...
BoltBait Posted October 15, 2012 Author Share Posted October 15, 2012 Must feel good to have a problem like that and just be able to knock out a plugin Yeah, CodeLab is the best plugin ever. Now, I can't speak for those who write canvas plugins, but I find that actually coding a plugin is the easy part. Coming up with the idea is the hard part. In this case, I wrote it to save myself a ton of time. Any time you find yourself doing the same steps multiple times, make a note of it. If you don't have the ability to code a plugin yourself, I'm sure someone would be able to automate those steps for you.* And, thanks for the vote. *Keeping in mind the limitations of the plugin system. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
nitenurse79 Posted October 15, 2012 Share Posted October 15, 2012 I have just used this plug-in on some old scans of mine with great results, thanks for sharing BoltBait Vote #2 heading your way Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted October 15, 2012 Share Posted October 15, 2012 It makes me fatter? Other than that I'm sold! 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...
BoltBait Posted October 15, 2012 Author Share Posted October 15, 2012 It makes me fatter? Actually, I think its the pizza that does that. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
cfries Posted March 15, 2013 Share Posted March 15, 2013 For those of us interested in the development, but without asking anyone to reveal any "trade secrets" may I ask what toolkit was used to take the code above to compiled .dll? Either way, one of the best, most useful plug-ins to any image management software I've seen anywhere. THANK YOU !!! Quote Link to comment Share on other sites More sharing options...
BoltBait Posted March 15, 2013 Author Share Posted March 15, 2013 For those of us interested in the development, but without asking anyone to reveal any "trade secrets" may I ask what toolkit was used to take the code above to compiled .dll? That would be CodeLab. Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted March 16, 2013 Share Posted March 16, 2013 ^^ He's too modest. CodeLab is developed and maintained by @BoltBait (free to download, donations welcomed). Damned fine piece of kit it is too! You'll find numerous excellent tutorials on BoltBait's website (link in his signature). 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...
locomotive Posted April 17, 2013 Share Posted April 17, 2013 This plug-in is great. I'm a total noob, but would it be hard for me to duplicate this to eliminate black dots? Quote Link to comment Share on other sites More sharing options...
BoltBait Posted April 17, 2013 Author Share Posted April 17, 2013 This plug-in is great. I'm a total noob, but would it be hard for me to duplicate this to eliminate black dots? Thanks. Here ya go... // Name: Remove Black Dust // Submenu: Photo // Author: BoltBait // URL: http://BoltBait.com/pdn private UserBlendOps.LightenBlendOp lightenOp = new UserBlendOps.LightenBlendOp(); void Render(Surface dst, Surface src, Rectangle rect) { for (int y = rect.Top; y < rect.Bottom; y++) { for (int x = rect.Left; x < rect.Right; x++) { ColorBgra CurrentPixel = src[x,y]; if (x>0) CurrentPixel = src[x-1,y]; CurrentPixel = lightenOp.Apply(src[x,y], CurrentPixel); dst[x,y] = CurrentPixel; } } } Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
nitenurse79 Posted April 19, 2013 Share Posted April 19, 2013 I am a total novice with codeLab, I have read about it on your website BB, but I am at a loss with this code, when I open codeLab how much of the script (code?) that is already there do I remove before I insert the above code you have provided? I tried to copy / paste this but ended up with errors at different lines. The removal of black dots is a useful tool to have with some of my scans too. You may have a virtual hug (or a rep point) if you can help me please Quote Link to comment Share on other sites More sharing options...
BoltBait Posted April 19, 2013 Author Share Posted April 19, 2013 How to use a codelab script (including the one above) 1) Highlight the above code block and press Ctrl-C. 2) Run Paint.NET and open the graphic you want to modify. 3) Effects > Advanced > Codelab 4) In codelab, Edit > Select All 5) Edit > Paste After a second the effect will compile and run. If you like the effect, click OK to keep the changes. 1 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
nitenurse79 Posted April 20, 2013 Share Posted April 20, 2013 Thank you BoltBait, that worked Have the promised Rep point for that. (and some cake) Quote Link to comment Share on other sites More sharing options...
RFX Posted April 22, 2013 Share Posted April 22, 2013 2 words sums it up, "epic win!" - Thanks again BoltBait! Quote Link to comment Share on other sites More sharing options...
Major Posted July 19, 2017 Share Posted July 19, 2017 Hello. I am really interested in downloading BoltBaits "Remove Dust" plugin for Paint.net version 4.0.16 but cannot find the direct link for it. I clicked on the second link below (copied from top of this page), but I'm not able to find the actual zip file. Would somebody please point me to it? Thank You so much. Download Here For Paint.NET 3.5.11: RemoveDust.zip For Paint.NET 4.0: http://forums.getpaint.net/index.php?/topic/28488- I'm thinking "Plugin of the Year". Yes? Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted July 19, 2017 Share Posted July 19, 2017 3 minutes ago, Major said: Hello. I am really interested in downloading BoltBaits "Remove Dust" plugin for Paint.net version 4.0.16 but cannot find the direct link for it. It's now part of his plugin pack: Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Major Posted July 19, 2017 Share Posted July 19, 2017 Can I just select that particular plug in from the rest of the pack? Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted July 19, 2017 Share Posted July 19, 2017 Just now, Major said: Can I just select that particular plug in from the rest of the pack? Yes, you can just select what you want. It won't force you to install everything contained in the pack. Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Major Posted July 19, 2017 Share Posted July 19, 2017 (edited) Thank you so much. I will give it a go tomorrow. I guess I need THIS one? 4.0.0-4.0.5 http://forums.getpaint.net/index.php?/topic/28488-b (Only if you can't upgrade to 4.0.6) If so, I'm still having trouble finding the actual download that is appropriate for my version 4.0.16 Edited July 19, 2017 by Major Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted July 19, 2017 Share Posted July 19, 2017 11 minutes ago, Major said: If so, I'm still having trouble finding the actual download that is appropriate for my version 4.0.16 I gave you the correct link. It says "v4.0.6+". Notice the plus sign... meaning version 4.0.6 and later versions. 1 Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Major Posted July 21, 2017 Share Posted July 21, 2017 Well this kind of stinks. I went and downloaded BoltBaitPack46.zip and it was stopped in it's tracks by my Norton 360 Antivirus suite. The zipped executable no longer works. I highly doubt that this is malware of any kind, but even turning auto protect off, Norton still caught it while trying to download it again. If anybody is interested, I attached a print screen. Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted July 21, 2017 Share Posted July 21, 2017 Norton is well known for crying wolf. Disable Norton then download and install the plugin. Better yet, delete Norton entirely - your world will be better for it. 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...
MJW Posted July 22, 2017 Share Posted July 22, 2017 You can restore the file if Norton deletes it. In the lower-right corner of the Norton file-warning window (in rather small letters), there's a Restore link. Click on it to restore the file Norton quarantined. Quote Link to comment Share on other sites More sharing options...
Marilynx Posted October 29, 2018 Share Posted October 29, 2018 On 10/14/2012 at 10:45 PM, BoltBait said: So, I was scanning a ton of photographs today and kept having to do the same steps to remove dust from the images. I automated it into a plugin. Enjoy. For Paint.NET 4.0: http://forums.getpaint.net/index.php?/topic/28488- I'm thinking "Plugin of the Year". Yes? Is this part of your plug-in pack? Ah, yes. Duh. It's under Effects => Photo. Altogether TOO reasonable a location. Quote 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.