What's coming in Paint.NET v3.35

This next update to Paint.NET will fix the usual set of small bugs, introduce a new adjustment (Posterize), fix a major performance blemish related to selections, and add an Intersect selection mode.

As for the small bug fixes, turns out there’s the possibility that Paint.NET will crash if malformed data is in the clipboard from, of all things, certain WPF-based applications. For effects that use IndirectUI, there was a problem with "linked" sliders (using LinkValuesBasedOnBooleanRule). And, it was possible to get around some of the protections that IndirectUI put up to protect Paint.NET from certain types of plugin code. Currently this only seems to affect the Fern Fractal plugin. I’ve e-mailed the author and helped him to find a way to accomplish what he wanted without "breaking the rules," so to speak.

Posterize is an adjustment written by Ed Harvey. It allows you to restrict each of the red, green, and blue channels to only have between 2 to 64 discreet values. Normally each channel has up to 256 values … 0 through 255, which is the range for a byte. This can be useful to give your image a "faux-dithered" look, although of course there are many other creative ways to use it.

Selection performance has been a major sore point in Paint.NET over the last 3 years or so. The initial drawing of a selection is fine — it’s when you go to use union (add) or difference (subtract) combination modes that things get froggy. Really froggy. As in slow. Pathetically slow.

We’ve been using a very brute force algorithm that converts the selection to a bit-mask, then performs the boolean operations on each bit, and then traces the bitmask to recreate a selection path (selections in Paint.NET are stored as a a polygon list). This causes these operations to have performance that is proportional to the number of pixels in the area where the selection is located (its bounding rectangle, actually). On a large or even medium-sized image, these are immediately prohibitve to use. This algorithm was originally developed for use by the Magic Wand tool so that we could do per-pixel tolerance, and then convert back to the polygon representation that was required everywhere else in the application.

There are algorithms that have been developed with let you do boolean algebra operations on the polygons themselves, optimizing away this very hacky (albeit correct!) way of doing things. One such algorithm is detailed in a 1992 paper by Bala R. Vatti titled, "A Generic Solution to Polygon Clipping." This is the algorithm implemented in the GPC (General Polygon Clipper) library written by Alan Murta from the Computer Science department at the University of Manchester in England. There are other algorithms that have been developed since, such as the one described in a 1998 paper by Günther Greiner and Kai Hormann titled, "Efficient Clipping of Arbitrary Polygons".

I have read both papers and tried to implement both of the algorithms. I have tried this several times, and have come close to completion but never quite made the leap to full comprehension, nor a finished implementation. I never had more than an evening or two in a row to devote to this pursuit — by my estimate, I would need at least a full two or three weeks. Maybe even a full month. These papers are from the academic world, and I haven’t had much practice there for quite some time! As such, the papers are very dense (in a good way) and require many readthroughs to fully understand.

I was never able to find a good implementation of the second algorithm by Grenier and Hormann, which was desirable because it was simpler and supposedly more efficient. In the end, GPC by Alan Murta won out: like previously mentioned, it is an implementation of Vatti’s algorithm, in C. It has been around for quite awhile and has needed no major revisions in many years. So, from an integrator’s standpoint (me!), it is the simplest and safest solution. I am happy to say that I have just purchased a Commercial Use license from the University of Manchester and that the next update to Paint.NET will be using it to substantially increase performance for selections!

This is a simple case of pragmatism versus idealism: ideally, I would have the time, the patience, and the mental acuity to implement these. In practice, it would take so long to do this myself that the cost of a Commercial Use License is actually the cheaper alternative. So for everyone who has donated to Paint.NET, this is how I’m using your money 🙂 This does affect anyone interested in using the Paint.NET source code for their own commercial purposes: if you need any of the code related to selection stuff, you will have to purchase your own Commercial Use License from the University of Manchester.

The only way to get a feel for the performance increase is to cheat a little, with the current version of Paint.NET. Boot it up and create a 1024×768 image. Now, draw a circle selection that encompasses the whole image. Next, go to the toolbar and where it says "Selection Mode:", click on the down-arrow and choose "Subtract." Next, Draw another circle that is inside of the one you just draw. It’s very very slow. Next, undo this foolish thing you just did. Set the "Selection Mode:" to be "Invert (xor)" (this is the one mode that GDI+ gives you for free!). Now draw that second circle again and notice how smooth everything is. In the next update, this performance will also be there for Add (Union) and Subtract! The usability improvement is real and honest, and I think everyone will really like it.

Next, I’ve decided to add an Intersect selection mode. I’m not sure why I never did this before, to be honest. It was trivial to do, especially since GPC supports it right out of the box. Many other drawing programs offer this — it simply makes sure that the result of combining two selections is the area in which they overlap.

Last, I’m reassigning the keyboard shortcuts for the selection modes. Before, you would hold Control for Add/union, hold the right mouse button for Subtract/difference, and Control+Right for Invert/Xor. These are kind of weird, and non-standard, and plus I needed a key for Intersect. So, in the next update the shortcuts will be Control for Add/union, Alt for Subtract/difference, Control+Right mouse button for Invert/Xor, and Alt+Right mouse button for Intersect.

I’m hoping to have a beta of v3.35 out within a few weeks, and the final release in early-to-mid July.

Paint.NET v3.31 is now available!

This is mostly a servicing release to fix a few important bugs that have been causing some people a lot of headaches. You can get it in the usual ways: either via the built-in updater (Help -> Check for Updates), or directly from the website: http://www.getpaint.net/.

Changes since v3.30:

* New: Enabled integration with Window Clippings, which is a high quality screen capture utility by Kenny Kerr.
* Fixed: Fixed a crash with the Open/Save dialogs if the Documents or Pictures directories were either inaccessible or if the user did not have certain file system permissions.
* Changed / Fixed: The hotkey for Adjustments -> Levels is now Ctrl+Shift+L instead of Ctrl+Alt+L. This was preventing certain characters, such as the Polish ‘Å‚’, from being typed.

For this update I’ve also worked with Kenny Kerr to enable integration between Paint.NET and his Window Clippings utility. It now has a built-in “Send to Paint.NET” action so that when you take a screenshot it will automatically send it to Paint.NET without a filename (“Untitled”). Before, this had to be done manually and it was a bit clumsy because it would show up in the File -> Open Recent menu with a long, computer generated file name. It was also tricky to ensure that the alpha channel, which Window Clippings captures correctly for Vista/Aero effects, made the trip correctly.

To kick this off, we also have a special deal — for the month of May we’re knocking $4 USD off the price of Window Clippings for Paint.NET users! Now it’s only $14 USD instead of $18 USD.

You will also see this offer when you install Paint.NET v3.31. I use this program myself, and it saves me a ton of time when I make screenshots, e.g. for the Paint.NET help and documentation. I really like how it automatically captures all of the Vista/Aero effects, such as the transparency and the drop shadow. I highly recommend it.

Paint.NET v3.31 is on the way

I’m shooting to have a version 3.31 release by this Thursday, May 1st. There’s a nasty bug that’s come up in the v3.30 code base that I need to fix! The problem occurs with my use of the native Win32 API, SHGetFolderPathW(). If your Documents or Pictures folder is on a network share, and that path is unavailable (network down, haven’t typed in credentials, etc. etc.), then Paint.NET will almost certainly crash when you go to Open or Save. The fix is simple enough, of course, but this is causing a lot of headaches and an inbox full of crash logs for me.

In other news, the weather here in Kirkland is great* and I’ve got the week off. I can finally reliably finish Green Grass and High Tides in Rock Band on Expert (4 stars), and Grand Theft Auto IV comes out tomorrow.

* Well, for now … who knows what tomorrow will be like!

Paint.NET v3.30 — Final release now available!

It’s finally here! You can grab it via the built-in updater from the Help-> Check for Updates menu item, or go get it straight from the website at http://www.getpaint.net/

Enjoy!

Changes since v3.22:

  • New: Italian translation.
  • New: Ability to save PNG’s at 8- and 24-bit color depths.
  • New: Ability to save BMP’s at 8-bit color depth.
  • New: "Auto-detect" bit-depth option for PNG, BMP, and TGA file types. It will analyze the image and determine the lowest bit-depth that can still save the image without quality loss.
  • New: "Fragment" blur effect, by Ed Harvey
  • New: The "Polar Inversion" distortion effect has been enhanced to allow changing the rendering offset, and the behavior for "edge" pixels (clamp, reflect, or wrap).
  • New: For developers, added a Color Wheel control to IndirectUI for use in effect plugins.
  • New: For developers, added ability to customize certain properties of the effect configuration dialog via IndirectUI.
  • New: For developers, IndirectUI can now be used to write configuration UI for file types.
  • New: For developers, IndirectUI has a new radio button control type for enumerations, and some new property constraint rules.
  • Changed: Most effects and adjustments, including plugins that use IndirectUI, have been visually refreshed. The new look is cleaner and more compact. These changes are shown in more detail at https://blog.getpaint.net/2008/03/10/cleaning-up-the-ui-for-paintnet-v330/
  • Fixed: Various UI issues with the Levels adjustment.
  • Fixed: When pasting text into the Text tool with Ctrl+V, it would hide the nub for moving the text.
  • Fixed: If the startup tool was set to the Zoom or Pan (Hand) tool, then the toolbar would render incorrectly.
  • Fixed: Thumbnails for PDN images now include transparency, which improves their appearance in Windows Vista.
  • Fixed: In some cases, an exponential property slider would get "stuck" at some values when using up/down keyboard keys. This mostly affects some effect plugins.
  • Fixed: When using keyboard navigation, sometimes the File menu would scroll its items out of view.
  • Fixed: Some crashes that were tracked down to out-of-bounds coordinate values in certain effects.
  • Fixed: The installer would fail if Paint.NET had never been installed before, and was being installed to any non-default directory. This bug only affected version 3.22.

Paint.NET v3.30 Release Candidate 1 is now available!

Well this has been an interesting release to push out the door … all sorts of interesting hurdles have come up including hardware threatening to fail, myself being really busy with other cool stuff at my day job, translators with food poisoning (they are better now thankfully!), and pyrochild’s computer refusing to work with a test build (pyrochild is an active and popular member of the Paint.NET forum). Have no fear though, it’s almost ready to go! I had a few code changes since Beta 2 so I decided to push out a Release Candidate instead of a "Final" build tonight. If all goes as planned, the final release will be pushed out this weekend.

As usual, you can get this build from the built-in updater (Help -> Check for Updates), or by downloading it straight off the website: http://www.getpaint.net/

Changes since Beta 2:

  • Fixed: Various UI issues with the Levels adjustment.
  • Fixed: When pasting text into the Text tool with Ctrl+V, it would hide the nub for moving the text.
  • Fixed: If the startup tool was set to the Zoom or Pan (Hand) tool, then the toolbar would render incorrectly.
  • Changed: Enabled some compiler settings which improve security via support for DEP (/nxcompat), and Windows Vista’s Address Space Layout Randomization feature (ASLR) (/dynamicbase).

As an aside, on April 1st the GIMP website had an interesting version of the Wilber image, and I have adopted it for my forum avatar for the time being …

Paint.NET v3.30 Beta 2 is now available

It’s been 2 weeks and I’ve been busy incorporating the feedback I’ve received so far on the first beta. Phew! Anyway, please note that this is a beta that expires in 60 days on May 11th. You can get this update by downloading it from the website, http://www.getpaint.net/ (no need to uninstall your current version, it will figure it all out for you), or via the built-in updater. For the latter, go to Help -> Check for Updates… and make sure you are set up to receive betas by clicking on the Options button and ensuring that "Also check for beta releases" is checked. Then close the dialogs and click on Help -> Check for Updates… again.

Changes since Beta 1:

  • Changed: Most effects and adjustments, including plugins that use IndirectUI, have been visually refreshed. The new look is cleaner and more compact. These changes are shown in more detail at https://blog.getpaint.net/2008/03/10/cleaning-up-the-ui-for-paintnet-v330/
  • Fixed: Thumbnails for PDN images now include transparency, which improves their appearance in Windows Vista.
  • New: For developers, added a Color Wheel control to IndirectUI for use in effect plugins.
  • New: For developers, added ability to customize certain properties of the effect configuration dialog via IndirectUI.

Enjoy!

Paint.NET v3.30 Beta 1 is now available

Alright, here we go: finally a new update to Paint.NET! Please note that this is a beta, and expires in 60 days on April 28th. You can get this update by downloading it from the website, http://www.getpaint.net/ (no need to uninstall your current version, it will figure it all out for you), or via the built-in updater. For the latter, go to Help -> Check for Updates… and make sure you are set up to receive betas by clicking on the Options button and ensuring that "Also check for beta relases" is checked. Then close the dialogs and click on Help -> Check for Updates… again.

The most notable features in this release are the ability to save PNG’s at 8- and 24-bit depth, and the integration of Ed Harvey’s "Fragment" blur effect. There are also a bunch of other minor things, bug fixes, and a new Italian translation.

List of changes:

  • New: Ability to save PNG’s at 8- and 24-bit color depths.
  • New: Ability to save BMP’s at 8-bit color depth.
  • New: "Auto-detect" bit-depth option for PNG, BMP, and TGA file types. It will analyze the image and determine the lowest bit-depth that can still save the image without quality loss.
  • New: "Fragment" blur effect, by Ed Harvey
  • New: The "Polar Inversion" distortion effect has been enhanced to allow changing the rendering offset, and the behavior for "edge" pixels (clamp, reflect, or wrap).
  • New: For developers, IndirectUI can now be used to write configuration UI for file types.
  • New: For developers, IndirectUI has a new radio button control type for enumerations, and some new property constraint rules.
  • New: Italian translation.
  • Fixed: In some cases, an exponential property slider would get "stuck" at some values when using up/down keyboard keys. This mostly affects some effect plugins.
  • Fixed: When using keyboard navigation, sometimes the File menu would scroll its items out of view.
  • Fixed: Some crashes that were tracked down to out-of-bounds coordinate values in certain effects.
  • Fixed: The installer would fail if Paint.NET had never been installed before, and was being installed to any non-default directory. This bug only affected version 3.22.

Enjoy!

Paint.NET v3.22 is now available

It’s that time again: a new version of Paint.NET! This release fixes a few minor bugs and adds a new, much-needed Reduce Noise effect. You can download it from the website at http://www.getpaint.net, or use the built-in updater by clicking on Help -> Check for Updates within the application.

Changes:

  • New: “Reduce Noise” effect.
  • Changed: Ctrl+W will now close Paint.NET if zero images are open.
  • Fixed: In Windows XP, when launching web content, sometimes Internet Explorer was used instead of the user’s chosen default browser.
  • Fixed: The Unfocus effect was not handling alpha values properly.
  • Fixed: The Brightness / Contrast adjustment was only displaying its text in English.
  • Fixed: The /auto parameter for the installer now correctly allows for an automated installation. This was inadvertently broken in 3.20.

Enjoy!

Paint.NET v3.22 Beta 2 is now available

There weren’t many changes for this update, but they’re all in the installer so I felt it was very important to get wider testing before trusting the code enough for a final release. Anyway, as usual you can get the update from the website at http://www.getpaint.net/ or you can use the built-in updater from the Help -> Check for Updates menu item. You will need to make sure that “Also check for Beta releases” is enabled, by clicking on the “Options” button after clicking the “Check for Updates” menu item.

Changes since Beta 1:

  • Fixed: Some uncommon installer bugs
  • Fixed: Very poor performance during installation or updating, sometimes causing the removal of the previous version to take 20 minutes

Enjoy!

Paint.NET v3.22 – Beta release now available

This release fixes a few minor bugs and adds a new, much-needed Reduce Noise effect. You can get it from the website (http://www.getpaint.net/) or via the built-in updater by going to Help -> Check for Updates. (Make sure that “Also check for beta releases” is enabled, by clicking on the “Options” button after clicking the “Check for Updates” menu item). Final release is tentatively scheduled for mid-January.

Changes:

  • New: “Reduce Noise” effect.
  • Changed: Ctrl+W will now close Paint.NET if zero images are open.
  • Fixed: In Windows XP, when launching web content, sometimes Internet Explorer was used instead of the user’s chosen default browser.
  • Fixed: Unfocus was not handling alpha values properly.
  • Fixed: Brightness / Contrast adjustment was only displaying its text in English.
  • Fixed: The /auto parameter for the installer now correctly allows for an automated installation. This was inadvertantly broken in 3.20.