null54 Posted May 13, 2020 Share Posted May 13, 2020 This is an extension of my gmic-sharp library that allows it to be used by Paint.NET Effects. It allows G'MIC commands to be applied to a Paint.NET Surface. https://github.com/0xC0000054/gmic-sharp-pdn The gmic-sharp-pdn-example Effect plugin demonstrates the use of the gmic-sharp-pdn library. It also provides an example of how to use ILMerge when building Paint.NET plugins. While this topic is primarily intended for plugin developers, users can download the example plugin, which wraps the G'MIC water command. An example of the effect can be can be seen on the deformations page of the G'MIC filter gallery, https://gmic.eu/gallery/deformations.shtml. Menu location: Distort > GmicSharpPdn Example Compatibility: 4.2.12+ GmicSharpPdnExample.zip 2 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...
Reptillian Posted May 13, 2020 Share Posted May 13, 2020 Given how simple the water example is, I think I feel confident about no longer needing to manually convert gmic code into c#. I will have to try this. I do have only two question though. 1) Does gmic command "to $_host" shows paintdotnet on canvas? 2) Is it possible to pass on clipboard image and use [1]? You noted [0] is a layer in gmic. Quote G'MIC Filter Developer I am away from this forum for undetermined amount of time: If you really need anything related to my PDN plugin or my G'MIC filter within G'MIC plugin, then you can contact me via Paint.NET discord, and mention me. Link to comment Share on other sites More sharing options...
null54 Posted May 13, 2020 Author Share Posted May 13, 2020 1 hour ago, Reptillian said: Does gmic command "to $_host" shows paintdotnet on canvas? No, it currently shows "gmic-sharp". I would have to change the gmic-sharp libraries to allow custom host strings. 1 hour ago, Reptillian said: 2) Is it possible to pass on clipboard image and use [1]? You noted [0] is a layer in gmic. Yes, I will add a commented out block of clipboard code to the example. You should also be able to use the IndirectUI file picker control. 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...
Reptillian Posted May 14, 2020 Share Posted May 14, 2020 (edited) One more question. What if I want a different view and/or avoid affecting the canvas during modifying setting. One example of a G'MIC filter that needs both of them is the Non-Isometric RPG Tiler (Interactive). I believe that you need to create an auxiliary surface to render the effect, and then send it to a preview window within the GUI. Rendering the end result after the interactive window is what comes after the prerender. Right? Edited May 14, 2020 by Reptillian Quote G'MIC Filter Developer I am away from this forum for undetermined amount of time: If you really need anything related to my PDN plugin or my G'MIC filter within G'MIC plugin, then you can contact me via Paint.NET discord, and mention me. Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted May 14, 2020 Share Posted May 14, 2020 PreRender is performed once. Subsequently Render is called multiple times, each call passing a "strip" of pixels (the so-called ROI or Rectangle of Interest). You might find this discussion helpful if you're considering utilizing a separate work surface: https://forums.getpaint.net/topic/22086-roi-and-shared-state-threading/ 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...
null54 Posted May 14, 2020 Author Share Posted May 14, 2020 6 hours ago, Reptillian said: What if I want a different view and/or avoid affecting the canvas during modifying setting. You would have to use a Windows Forms dialog if you what to control what settings cause Paint.NET to start rendering its preview on the canvas. 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...
null54 Posted July 14, 2020 Author Share Posted July 14, 2020 Released version 0.2.0. Changes: Added support for G'MIC filters that produce multiple output images. Renamed the Output property to OutputImages and changed the return type to IReadOnlyList<PdnGmicBitmap>. The host application name is now set to paintdotnet. Reduced memory usage when editing grayscale images. The GmicSharpNative binaries are now located in a folder. 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...
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.