Pat L Posted January 4, 2020 Share Posted January 4, 2020 (edited) Style Transfer Effect Download the Installer from Github (warning - 53 MB download 😟) Requirements: Paint.NET v4.2.* (tested with 4.2.8) Windows 7 or later, 64 bit version (sorry about that😟) a lot of RAM (should work fine with 8 GB, but 16 GB or more are recommended, especially for bigger images) a fast CPU (no GPU hardware acceleration at this point) - it can take a long time to render the effect Supported UI languages: English (including British English to put the "U" back in colour☺️) German French Portuguese Spanish Russian Let me know, if you can help me with adding languages or improve the existing localisation. You can find the effect under "Effects->Artistic->Style Transfer". But what does it do? This effect can be used to transfer the style of one image to another. The effect uses neural networks trained on a bunch of images to achieve this. You can either select a style from list of presets (including a fancy before-and-after-slider for viewing an example): The "Stylize Amount"-slider lets you adjust the ratio between the selected style and the content image style. Note that this is not a simple alpha-blend, though. Even selecting zero ("0") will change the content image significantly, as the model tries to apply the style extracted from the content to the content itself. This process isn't perfect by any means, so keep that in mind. "Style Extraction" and "Style Transfer" models can be selected as well. The "High Quality" setting uses a larger model for extracting and transferring styles. The "Fast"-option selects a smaller, "distilled" version of the higher quality one that requires less memory and less CPU power. The results will be very different between the models and depending on the selected style and amount,you might even prefer one over the other. Or you can create your own style by using an image of your choice: Clicking the "Select Style Image"-button or clicking the style image preview directly, will open a file dialog for image selection. The "Style Image Size"-slider determines the relative scaling factor of the style image that is used before the style is analysed. Think of it as how much of the style image the model is allowed to "see" before the style is extracted. The coloured bar below the slider indicates a size range that will probably yield the best-looking results, with the green arrow pointing at the recommended value. You can select values outside this range (though RAM and minimum size restrictions still apply), but the results may not be as good. The plugin will display a warning, if you choose a combination of a big style image and large style size: This happens, because the processing requires a large amount of RAM and once you use more RAM than is physically installed in your computer, your system will crawl to a halt, become unresponsive, and eventually even crash Paint.NET. The plugin will not use your settings, if they would result in too much RAM being used to protect the system from running out of memory. I hope you find this effect useful and have as much fun playing around with it as I had creating it ☺️! PS: the source code is available on Github - if you can, please use Github to report any issues, bugs, and feature requests. Edited January 4, 2020 by Pat L added another example image 5 1 Quote Link to comment Share on other sites More sharing options...
HyReZ Posted January 5, 2020 Share Posted January 5, 2020 Thank you! I will try it soon. Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted January 5, 2020 Share Posted January 5, 2020 Hello & welcome Pat. Wow. That's quite an introduction I'm impressed. The list of presets is fabulous. I'm off to play with this new toy. Thank you! 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...
homebrew Posted January 5, 2020 Share Posted January 5, 2020 fine results, but takes too much time to be applied, between 1 and 2 mn (24Go RAM), without real time preview. don't know if i'm mistaken. Quote Link to comment Share on other sites More sharing options...
Eli Posted January 5, 2020 Share Posted January 5, 2020 @Pat L Thank you for this effect. It looks awesome for what I have read but I can not test it on my very old PC. Quote Link to comment Share on other sites More sharing options...
Panchdara Posted January 5, 2020 Share Posted January 5, 2020 2 hours ago, homebrew said: fine results, but takes too much time to be applied, between 1 and 2 mn (24Go RAM), without real time preview. don't know if i'm mistaken. Yeah, quite time consuming - even if you cancel. Seems to go thru all the segments even though you click cancel. but, but, THANK YOU! Quote Link to comment Share on other sites More sharing options...
Pat L Posted January 5, 2020 Author Share Posted January 5, 2020 37 minutes ago, Panchdara said: Yeah, quite time consuming - even if you cancel. Seems to go thru all the segments even though you click cancel. but, but, THANK YOU! Yes, unfortunately proper support for "Cancel" is currently on the todo-list. Well that and support for GPU-accelerated processing. I am currently looking at a few options on how to achieve this, so stay tuned for updates👍 Quote Link to comment Share on other sites More sharing options...
lynxster4 Posted January 5, 2020 Share Posted January 5, 2020 (edited) Wow! Really impressed with this @Pat L. Got a lot of things racing in my head now. Thanks for this! Magical! Edited January 5, 2020 by lynxster4 2 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...
kernjiro Posted January 7, 2020 Share Posted January 7, 2020 Can anyone elaborate on the installation? I installed NSIS, the Installer.nsi file didn't compile, so I compiled the zip and that worked (I think) but it just gave me a very similar looking folder and another Installer.nsi file that didn't compile Quote Link to comment Share on other sites More sharing options...
HyReZ Posted January 7, 2020 Share Posted January 7, 2020 (edited) I simply loaded the executable called 'StyleTransferEffect-Installer.exe' and it installed the 'StyleTransferEffect.dll" into the 'Program Files>paint.net>Effects' folder. This is the link provided at the top of this thread:Download the Installer from Github Edited January 7, 2020 by HyReZ Quote Link to comment Share on other sites More sharing options...
kernjiro Posted January 7, 2020 Share Posted January 7, 2020 Oh wow I got a different github link and came here just because there wasn't a forum where I got it. Been trying to build the project in visual studio for hours. You're a life saver Quote Link to comment Share on other sites More sharing options...
HyReZ Posted January 7, 2020 Share Posted January 7, 2020 (edited) The information at the github link seems to be for ByteHeads. I am pleased that an installer was provided. ( Even providing the .dll would have been just as good for me.) Edited January 7, 2020 by HyReZ Quote Link to comment Share on other sites More sharing options...
HyReZ Posted January 7, 2020 Share Posted January 7, 2020 (edited) 😞 Edited March 10, 2020 by HyReZ 3 Quote Link to comment Share on other sites More sharing options...
SabreS Posted May 11, 2021 Share Posted May 11, 2021 The installer is saying I don't have it installed and then just closes, could it be because I purchased it through the microsoft store? Could I just directly download the dll and other necessary files somehow? Quote Link to comment Share on other sites More sharing options...
Pixey Posted May 11, 2021 Share Posted May 11, 2021 57 minutes ago, SabreS said: could it be because I purchased it through the microsoft store? Yes, the folders are in different place from the Classic. Please read 1/2 way down this thread on how and where to put the Effects folder: Install Plugins (getpaint.net) Quote How I made Jennifer & Halle in Paint.net My Gallery | My Deviant Art "Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon. Link to comment Share on other sites More sharing options...
ReMake Posted May 11, 2021 Share Posted May 11, 2021 4 hours ago, SabreS said: Could I just directly download the dll and other necessary files somehow? 7-Zip is the only archiver that could open the file StyleTransferEffect-Installer.exe. Right click on StyleTransferEffect-Installer.exe and select Extract. In the StyleTransferEffect-Installer folder that the archiver created, select the files shown in the image below (including the folder with your native language file). Move these files to your folder Documents\paint.net App Files\Effects. But... After applying this effect, you will get the following error message: Spoiler File: D:\Пользователи\Документы\paint.net App Files\Effects\StyleTransferEffect.dll Effect Name: PaintDotNet.Effects.ML.StyleTransfer.Plugin.StyleTransferEffect Full error message: PaintDotNet.WorkerThreadException: Worker thread threw an exception ---> System.MethodAccessException: Attempt by method 'PaintDotNet.Effects.ML.StyleTransfer.Plugin.StyleTransferEffect.OnRender(System.Drawing.Rectangle[], Int32, Int32)' to access method 'PaintDotNet.RenderArgs.get_ISurface()' failed. at PaintDotNet.Effects.ML.StyleTransfer.Plugin.StyleTransferEffect.OnRender(Rectangle[] renderRects, Int32 startIndex, Int32 length) at PaintDotNet.Effects.ML.StyleTransfer.Plugin.StyleTransferEffect.OnSetRenderInfo(StyleTransferEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs srcArgs) at PaintDotNet.Effects.Effect`1.OnSetRenderInfo(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs) in D:\src\pdn\src\Effects\Effect`1.cs:line 71 at PaintDotNet.Effects.BackgroundEffectRenderer.ThreadFunction() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 268 --- End of inner exception stack trace --- at PaintDotNet.Effects.BackgroundEffectRenderer.DrainExceptions() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 447 at PaintDotNet.Menus.EffectMenuBase.DoEffect(Effect effect, EffectConfigToken token, Result`1 lazySelectionScans, Result`1 lazyRegionToRenderScans, Result`1 lazyClipMaskRenderer, Surface originalSurface, Exception& exception) in D:\src\pdn\src\PaintDotNet\Menus\EffectMenuBase.cs:line 0 Unfortunately, @Pat L last visited the forum on January 17, 2020. However, he was on github three weeks ago. You can tell him there about the detected failure and maybe he will fix the problem. Quote Link to comment Share on other sites More sharing options...
AndrewDavid Posted May 12, 2021 Share Posted May 12, 2021 I have been trying to report this crash for weeks. The thread was not allowing me to save my replies. I believe the latest update to Paint.Net is somehow causing the crashes. 1 Quote Link to comment Share on other sites More sharing options...
Pixey Posted May 12, 2021 Share Posted May 12, 2021 11 hours ago, AndrewDavid said: I believe the latest update to Paint.Net is somehow causing the crashes. I think the MS updates are causing havoc. I too have been experiencing many strange happenings of late. Also, does @Red ochre Quote How I made Jennifer & Halle in Paint.net My Gallery | My Deviant Art "Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon. Link to comment Share on other sites More sharing options...
AndrewDavid Posted May 12, 2021 Share Posted May 12, 2021 I did get 4 updates to Win 10 last night, but the error is still occurring. Now that I can post, I've included my crash log. Spoiler File: C:\Program Files\paint.net\Effects\StyleTransferEffect.dll Effect Name: PaintDotNet.Effects.ML.StyleTransfer.Plugin.StyleTransferEffect Full error message: PaintDotNet.WorkerThreadException: Worker thread threw an exception ---> System.MethodAccessException: Attempt by method 'PaintDotNet.Effects.ML.StyleTransfer.Plugin.StyleTransferEffect.OnRender(System.Drawing.Rectangle[], Int32, Int32)' to access method 'PaintDotNet.RenderArgs.get_ISurface()' failed. at PaintDotNet.Effects.ML.StyleTransfer.Plugin.StyleTransferEffect.OnRender(Rectangle[] renderRects, Int32 startIndex, Int32 length) at PaintDotNet.Effects.ML.StyleTransfer.Plugin.StyleTransferEffect.OnSetRenderInfo(StyleTransferEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs srcArgs) at PaintDotNet.Effects.Effect`1.OnSetRenderInfo(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs) in D:\src\pdn\src\Effects\Effect`1.cs:line 71 at PaintDotNet.Effects.BackgroundEffectRenderer.ThreadFunction() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 268 --- End of inner exception stack trace --- at PaintDotNet.Effects.BackgroundEffectRenderer.DrainExceptions() in D:\src\pdn\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 447 at PaintDotNet.Menus.EffectMenuBase.DoEffect(Effect effect, EffectConfigToken token, Result`1 lazySelectionScans, Result`1 lazyRegionToRenderScans, Result`1 lazyClipMaskRenderer, Surface originalSurface, Exception& exception) in D:\src\pdn\src\PaintDotNet\Menus\EffectMenuBase.cs:line 0 Quote Link to comment Share on other sites More sharing options...
null54 Posted May 12, 2021 Share Posted May 12, 2021 13 hours ago, AndrewDavid said: I believe the latest update to Paint.Net is somehow causing the crashes. It looks like @toe_head2001 submitted a patch on GitHub, so the author should hopefully make an update available soon. 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...
bruh_where_cheese Posted August 31, 2022 Share Posted August 31, 2022 (edited) hi there i donwload the plugin it just says errors what do i do. tried my best but seem to not work. oh yeah heres the error it gives me File: S:\paint.net\Effects\StyleTransferEffect.dll Effect Name: PaintDotNet.Effects.ML.StyleTransfer.Plugin.StyleTransferEffect Full error message: PaintDotNet.WorkerThreadException: Worker thread threw an exception ---> Microsoft.ML.OnnxRuntime.OnnxRuntimeException: [ErrorCode:Fail] D:\Repos\onnxruntime\onnxruntime\core\session\inference_session.cc:262 onnxruntime::InferenceSession::InferenceSession result was false. Could not parse model successfully while constructing the inference session at Microsoft.ML.OnnxRuntime.NativeApiStatus.VerifySuccess(IntPtr nativeStatus) at Microsoft.ML.OnnxRuntime.InferenceSession.Init(Byte[] modelData, SessionOptions options) at PaintDotNet.Effects.ML.StyleTransfer.EffectModel.Reset(Byte[] modelData) at PaintDotNet.Effects.ML.StyleTransfer.Plugin.StyleTransferEffect.OnSetRenderInfo(StyleTransferEffectConfigToken newToken, RenderArgs dstArgs, RenderArgs srcArgs) at PaintDotNet.Effects.Effect`1.OnSetRenderInfo(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs) in D:\src\pdn\src_4_3_x\Effects\Effect`1.cs:line 68 at PaintDotNet.Effects.BackgroundEffectRenderer.ThreadFunction() in D:\src\pdn\src_4_3_x\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 266 --- End of inner exception stack trace --- Edited August 31, 2022 by bruh_where_cheese Quote Link to comment Share on other sites More sharing options...
Pixey Posted August 31, 2022 Share Posted August 31, 2022 13 hours ago, bruh_where_cheese said: ried my best but seem to not work. Yes, this Plugin is not working. I will post the Error message on the developer's Git Hub page, as requested. Hopefully this can be fixed. EDIT: The developer has responded and is working on it 1 1 Quote How I made Jennifer & Halle in Paint.net My Gallery | My Deviant Art "Rescuing one animal may not change the world, but for that animal their world is changed forever!" anon. 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.