ArgusMagnus Posted September 23, 2015 Share Posted September 23, 2015 (edited) Effect->Stylize->Edge Detect+ Download: https://forums.getpaint.net/topic/32337-argusmagnus-plugin-pack-20181019/ (Copy the file ArgusPDN.EdgeDetect.dll to the paint.net/Effects folder) This effect uses an edge detection algorithm. It draws edges with given colors and sets the other pixels to transparent. I haven't had any good idea for the name, so I called it Edge Detection for now, the (Argus) is simply to make it better distinguishable from the built in Edge Detect effect. If anyone has an idea for a better name, feel free to share it ? UI Explanation (See example below): Lower Threshold: All pixels with values (Structur Tensor Eigenvalues) below this threshold are fully transparent: Higher Threshold --> Less Edges detected Upper Threshold: All pixels with values above this threshold are fully opaque. The range of "good" values really depends on the image. For hard edges (extreme case: black line on white), "good" values may go up to 1, for softer edges (as typically found in photographes), "good" values will usually be below 0.2 Color/Color2/Angle/Hue Direction: Edges with a normal angle the same as the chosen Angle are drawn in the color set in Color, edges with a normal angle perpendicular to Angle are drawn in the color set in Color2, in between the color is interpolated between Color and Color2. Hue Direction determines how the Hue value is interpolated. Difference Filter: The Kernel used to get the image derivates in x and y direction. I have yet to encounter a situation where I needed to change this value. If you change this value, a lot of calculations have to be redone. Some time may pass before you see something happening. Smoothing Radius: As expected, smoothes the output. Performance: Calculating initial values (Structur Tensors) may take some time, therefore, depending on the selection size, it may take some time after the effect dialog pops up before you can see something happening. If you change the value "Difference Filter" these calculations have to be redone. Smoothing is also somewhat expensive, which you can see if you change the smoothing radius. Intermediate values (Structur Tensors, eigenvalues of smoothed Tensors) are held in memory so re-rendering the output for different Threshold/Color/Angle values is fast. The cost for that is memory usage: Roughly 24 bytes per Pixel are used (excluding the memory used for the source and destination surface). Edited October 19, 2018 by ArgusMagnus Added links to zipped DLL of Null54's updated version 1 8 Quote My batch Image Processor: https://imagenator.codeplex.com Link to comment Share on other sites More sharing options...
Eli Posted September 23, 2015 Share Posted September 23, 2015 Thanks ArgusMagnus. Interesting effect. I copied the original on four layers and used different settings for each one to obtain this. 2 Quote Link to comment Share on other sites More sharing options...
Red ochre Posted September 23, 2015 Share Posted September 23, 2015 Interesting effect Argus - thanks for sharing! Clever way of linking the two threshold sliders and limiting the angle chooser.Unfortunately I managed to crash it! (or rather it crashed Pdn). Threading error below.I had successfully used the effect. I then used 'undo' (to duplicate my original 1281 by 907 image). Then used 'Effects/repeat Edge detection (Argus)' which caused the crash.File: C:\Program Files\paint.net\Effects\ArgusPaintNet.EdgeDetection.dll Name: ArgusPaintNet.EdgeDetection.EdgeDetectionEffect Version: 1.0.5744.32049 Author: Argus Magnus Copyright: Copyright © ArgusMagnus 2015 Website: http://www.getpaint.net/redirect/plugins.html Full error message: PaintDotNet.WorkerThreadException: Worker thread threw an exception ---> System.NullReferenceException: Object reference not set to an instance of an object. at ArgusPaintNet.EdgeDetection.EdgeDetectionEffect.OnSetRenderInfo(PropertyBasedEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs srcArgs) at PaintDotNet.Effects.Effect`1.OnSetRenderInfo(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs) in d:\src\pdn\paintdotnet\src\Effects\Effect`1.cs:line 67 at PaintDotNet.Effects.BackgroundEffectRenderer.ThreadFunction() in d:\src\pdn\paintdotnet\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 218 --- End of inner exception stack trace --- at PaintDotNet.Effects.BackgroundEffectRenderer.DrainExceptions() in d:\src\pdn\paintdotnet\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 431 at PaintDotNet.Menus.EffectMenuBase.DoEffect(Effect effect, EffectConfigToken token, PdnRegion selectedRegion, PdnRegion regionToRender, IRenderer`1 clipMaskRenderer, Surface originalSurface, Exception& exception) in d:\src\pdn\paintdotnet\src\PaintDotNet\Menus\EffectMenuBase.cs:line 1527 1 Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Eli Posted September 23, 2015 Share Posted September 23, 2015 I had the same problem when I used the "REPEAT" option. I thought it was my computer since it is a kind of old. Quote Link to comment Share on other sites More sharing options...
ArgusMagnus Posted September 23, 2015 Author Share Posted September 23, 2015 Thanks for the feedback red ochre. I've uploaded a fix, should work now. (The problem was, that the initialization method was not called, when the effect was run without UI via repeat) Quote My batch Image Processor: https://imagenator.codeplex.com Link to comment Share on other sites More sharing options...
Red ochre Posted September 23, 2015 Share Posted September 23, 2015 Thanks for the quick bug fix! Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
racerx Posted September 23, 2015 Share Posted September 23, 2015 (edited) Great effect, much better than the one built-in to PDN. You really should zip your files instead of leaving open xxx.dll's on a server somewhere, it's a bit unsettling to download them like that.... Here is another cool one. It looks almost frozen..... Edited September 23, 2015 by racerx 2 Quote Link to comment Share on other sites More sharing options...
Red ochre Posted September 24, 2015 Share Posted September 24, 2015 Good examples RacerX - second one has a great smashed glass/ice look! Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
ArgusMagnus Posted September 24, 2015 Author Share Posted September 24, 2015 (edited) Small Update: I changed the range of the threshold values and improved cancelling behaviour. I'm not sure this is the optimum yet. The problem is, that the range which makes sense really depends on the image. For an image with hard edges (black on white), one would want a large range, possibly with a maximum even above 1. For images with softer edges (photographes, realistic drawings, etc.) chosen values will likely be below 0.2 or even 0.1. Of course these values can be chosen even if the range is [0,1] but its less confortable if you have a slider going from 0 to 1 but you are only interested in values between 0 and 0.1. So if you think, I should allow another range for the sliders, tell me @racerx: The assemblies are not zipped up, because... well... essentially because it's easier for me (I would need to have multiple zip files of which most would contain the ArgusPaintNet.Shared.dll file, so I would need to update every zip if I updated the shared dll and wanted all zips to contain the newest version). But if you select multiple files or download the whole folder, OneDrive will zip it up for you Edited September 24, 2015 by ArgusMagnus Quote My batch Image Processor: https://imagenator.codeplex.com Link to comment Share on other sites More sharing options...
Seerose Posted September 24, 2015 Share Posted September 24, 2015 (edited) ArgusMagnus! Thank you very much for the plugin and your effort. Sorry! Tomorrow's day. Edited September 24, 2015 by Seerose 2 Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi Link to comment Share on other sites More sharing options...
nitenurse79 Posted September 24, 2015 Share Posted September 24, 2015 This looks very interesting Argus. A worthy plugin, thank you for the share Quote Link to comment Share on other sites More sharing options...
ArgusMagnus Posted October 1, 2015 Author Share Posted October 1, 2015 Would "Edge Detect+" be a better name? According to the plugin index it is not taken yet. Does anyone use the "Corner" mode? (This plugin originally started out as a corner detection plugin, but as I kept going and tested the plugin, I began to see, that edge detection yields much more interesting results than corner detection and the math is almost identical, so switching between the two modes requires very little code changes). If not, I might remove the option altogether and instead add an option to perform the algorithm and different versions of the image. Currently the algorithm is performed on a grayscale image, but it could just as easily be run on individual channels Quote My batch Image Processor: https://imagenator.codeplex.com Link to comment Share on other sites More sharing options...
racerx Posted October 1, 2015 Share Posted October 1, 2015 I tried the Corner Mode, but didn't like the results. Replacing it with something better sounds like a good idea to me. Quote Link to comment Share on other sites More sharing options...
Tuckeroo Posted September 17, 2018 Share Posted September 17, 2018 I have installed the new paint dot net update and now this plug in is crashing: File: E:\Program Files\paint.net\Effects\ArgusPaintNet.EdgeDetection.dll Name: ArgusPaintNet.EdgeDetection.EdgeDetectionEffect Version: 1.0.5744.38119 Author: Argus Magnus Copyright: Copyright © ArgusMagnus 2015 Website: http://www.getpaint.net/redirect/plugins.html Full error message: PaintDotNet.WorkerThreadException: Worker thread threw an exception ---> System.TypeLoadException: Could not load type 'PaintDotNet.Rendering.VectorFloat' from assembly 'PaintDotNet.Base, Version=4.101.6828.39058, Culture=neutral, PublicKeyToken=null'. at ArgusPaintNet.Shared.StructurTensor.GetCharacteristics() at ArgusPaintNet.EdgeDetection.EdgeDetectionEffect.GetCharacteristics(Rectangle rect, TensorCharacteristics[,] values) at ArgusPaintNet.Shared.CachedValues`1.GetValues(Rectangle roi) at ArgusPaintNet.EdgeDetection.EdgeDetectionEffect.OnRender(Rectangle[] renderRects, Int32 startIndex, Int32 length) at PaintDotNet.Effects.Effect`1.Render(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs, Rectangle[] rois, Int32 startIndex, Int32 length) in D:\src\pdn\src\Effects\Effect`1.cs:line 98 at PaintDotNet.Effects.BackgroundEffectRenderer.RenderWithClipMask(Effect effect, EffectConfigToken token, RenderArgs dstArgs, RenderArgs srcArgs, RectInt32[] rois, IRenderer`1 clipMaskRenderer) in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 196 at PaintDotNet.Effects.BackgroundEffectRenderer.RendererContext.RenderTile(EffectConfigToken token, Int32 tileIndex) in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 175 at PaintDotNet.Effects.BackgroundEffectRenderer.RendererContext.RenderNextTile(EffectConfigToken token) in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 167 at PaintDotNet.Effects.BackgroundEffectRenderer.ThreadFunction() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 267 --- End of inner exception stack trace --- at PaintDotNet.Effects.BackgroundEffectRenderer.DrainExceptions() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 443 at PaintDotNet.Effects.BackgroundEffectRenderer.Abort() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 399 at PaintDotNet.Effects.BackgroundEffectRenderer.Start() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 345 at PaintDotNet.Menus.EffectMenuBase.<>c__DisplayClass45_5.<RunEffectImpl>b__5() in D:\src\pdn\src\PaintDotNet\Menus\EffectMenuBase.cs:line 1094 Any help would be appreciated Thanks Jeanette Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted September 17, 2018 Share Posted September 17, 2018 @Tuckeroo, the plugin will need to be updated for Paint.NET v4.1 or newer. Some types were moved/renamed -- in this case, VectorFloat is now Vector2Float. (technically plugins were/are not supposed to use types like that, although that should be changing soon ... just not yet) 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...
Tuckeroo Posted September 17, 2018 Share Posted September 17, 2018 (edited) Thanks Rick. Looking forward this plugin being updated. I use it regularly! Edited September 17, 2018 by Tuckeroo Quote Link to comment Share on other sites More sharing options...
null54 Posted September 18, 2018 Share Posted September 18, 2018 6 hours ago, Tuckeroo said: Thanks Rick. Looking forward this plugin being updated. I use it regularly! I recompiled the plugin for Paint.NET 4.1.1 using the source code @ArgusMagnus posted. Changes: Added a replacement VectorFloat structure to ArgusPaintNet.Shared. Changed ArgusPaintNet.EdgeDetection to get the "Stylize" menu name from the SubmenuNames class. Edge Detection.zip Source.zip 4 1 Quote Plugin Pack | PSFilterPdn | Content Aware Fill | G'MIC | Paint 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 More sharing options...
Tuckeroo Posted September 18, 2018 Share Posted September 18, 2018 Wonderful! Thank you! Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted October 1, 2018 Share Posted October 1, 2018 On 9/18/2018 at 1:57 PM, null54 said: I recompiled the plugin for Paint.NET 4.1.1 using the source code @ArgusMagnus posted. Added to the first post. Thanks @null54! 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...
alfredo55 Posted October 1, 2018 Share Posted October 1, 2018 Now this wonder pluin works perfect Quote Link to comment Share on other sites More sharing options...
ArgusMagnus Posted October 19, 2018 Author Share Posted October 19, 2018 Updated, see https://forums.getpaint.net/topic/32337-argusmagnus-plugin-pack-20181019/ Quote My batch Image Processor: https://imagenator.codeplex.com Link to comment Share on other sites More sharing options...
lynxster4 Posted October 20, 2018 Share Posted October 20, 2018 Hi @ArgusMagnus Thanks for updating your plugin pack! ? I have two observations. On this particular plugin (Edge Detect+), you altered the UI and added a 'Tensor Smoothing Radius' slider. I don't know what that does. Could you update the images in the first post and explain it? And, point #2, your 'Convolution' plugin is no longer in the pack. I use this quite frequently on certain 'styles' of artwork. It still works fine, but you should mention that everyone is still going to need to keep your 'Shared' .dll in the effects folder for it to work. Thank you for all your hard work. Quote My Art Gallery | My Shape Packs | ShapeMaker Mini Tut | Air Bubble Stained Glass Chrome Text with Reflections | Porcelain Text w/ Variegated Coloring | Realistic Knit PatternOpalescent Stained Glass | Frosted Snowman Cookie | Leather Texture | Plastic Text | Silk Embroidery Visit my Personal Website "Never, ever lose your sense of humor - you'll live longer" Link to comment Share on other sites More sharing options...
ArgusMagnus Posted October 20, 2018 Author Share Posted October 20, 2018 Thanks for the feedback. 1. Thats actually a left-over I missed, which has no effect as of now 2. I plan on also re-releasing the convolution plugin, so sit tight 1 Quote My batch Image Processor: https://imagenator.codeplex.com Link to comment Share on other sites More sharing options...
lifeday Posted December 18, 2018 Share Posted December 18, 2018 Some models tried out, only with these two pictures it seems to have worked out to some extent :-))))) The plugin is the revision of 2018 and the results are probably a bit different!?? But it's OK! 2 Quote Link to comment Share on other sites More sharing options...
Seerose Posted December 19, 2018 Share Posted December 19, 2018 Dear @lifeday! First picture looks like "Retro", and Second "Romantic Dreams". Thank you for sharing this with us! 1 Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi 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.