Sign in to follow this  
Simon Brown

What is and isn't possible when writing plugins

Recommended Posts

Simon Brown    38

As-of Paint.NET 3.5.2. This information is not official and some parts may be slightly inaccurate.

Non plugin authors often don't know what is and isn't possible when writing plugins - so hopefully this should be helpful to users wishing to suggest plugins.

Effects

  • Effects can only access the current layer.
  • Effects can only access the current image.
  • Effects cannot know or change the blend mode or transparency of a layer.
  • Effects can blend two images using transparency and blend modes.
  • Effects can read the whole layer, even if part of it is selected.
  • If part of a layer is selected, effects can only change that part.
  • Although effects can't be tools or anything, they can show a new dialog to draw on.
  • Effects can save files, but only with the information they have (see above) and they can't make the file they save the current FileName.
  • Effects have no control over the UI other than the ability to add items and categories to the effects and adjustments menus.
  • Effects can not change the shape of the selection or which pixels are selected.
  • Most effects need to be heavily modified before they can run outside Paint.NET.
  • Effects can open files and read them from your harddrive or Internet URL.
  • Effects can read the Windows clipboard.
As of paint.net 4.0.6:
  • Effects can read all of the color values in the current and default palette
  • Effects can add a [?] button to the effect's IndirectUI for adding a help file
FileTypes (Opening)
  • FileTypes don't know the location of the image they're opening.
  • FileTypes can create as many layers as they want and change opacity and blend modes.
  • FileTypes must open some image.
  • FileTypes have no control over the open dialog.
FileTypes (Saving)
  • FileTypes don't know the location of the image they're saving to.
  • FileTypes can read all layers, opacity and blend modes.
  • FileTypes have to save a file unless the user clicks "cancel," even if it is empty - this is frowned upon by Rick.
  • FileTypes have no control over the save dialog.
I hope this helps. Edited by BoltBait
Added 4.0.6 info.
  • Upvote 1

Share this post


Link to post
Share on other sites
david.atwell    280

Nice work. I'll definitely link to this when people post crazy ideas. :-)

A few notes you might want to make, though:

Plugins can put menu options in the Effects and Adjustments menu.

Plugins can not make any changes to the Paint.NET user interface outside their dialog and their menu entry.

Plugins can not run without Paint.NET, although they are able to connect to programs that can (such as Batch Processor and wrappers).

Also, if I'm not mistaken, Rick frowns on saving an empty file with a filetype plugin (such as with the upload-to idea).

Share this post


Link to post
Share on other sites
Boude    2

Is it possible to let an effect save one layer and then let the user runs the effect over the next layer and let the effect combine them some how? (not that I actually know how this could be done)

Share this post


Link to post
Share on other sites
jxp    1

A couple more comments on file types;

Filetypes have no control over the open/save dialog but can present their own dialog as well.

When opening, a file type plugin can return null or a 0 size document (don't know which is preferred) if the user cancels a custom dialog.

I have not found any good way to cancel a file type save dialog. I always end up with a zero byte file on disk.

The Paint.net jpg dialog allows a cancel, but plugins don't seem to be able to be consistent with this :(

Share this post


Link to post
Share on other sites
BoltBait    1,226

As of paint.net 4.0.6:

  • Effects can read all of the color values in the current and default palette
  • Effects can add a [?] button to the UI for adding a help file

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this