Jump to content

GmicSharpPdn Beta (2020-07-14)


Recommended Posts

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

  • Like 1
  • Upvote 1
Link to post
Share on other sites

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.

Link to post
Share on other sites
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.

 

Link to post
Share on other sites

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 by Reptillian
Link to post
Share on other sites

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/

 

 

Link to post
Share on other sites
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.

Link to post
Share on other sites

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.
  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...