4.1.7 alpha build 7079 is now available

I believe I’ve fixed the issues that were preventing some images from being saved (as reported earlier). I also fixed a few things in the Save Configuration dialog that were supposed to make it into alpha build 7077, but didn’t because I incorrectly merged my pull request on GitHub.

The issue with the images that wouldn’t save was that they had UserComment metadata in them (EXIF tag ID #37510). WIC (Windows Imaging Component) handles this in a way that my code wasn’t coping with, so the data didn’t round-trip correctly, and WIC decided to refuse the transaction instead. (And there was another bug: part of my wrapper was returning an error when WIC tried to send an IStream::Write() call with a 0 byte payload … weird, probably a bug in their code, but shouldn’t have broken down on my side.)

To download, head on over to the forum. I’m currently adding this to the auto-updater as well, so in a few minutes you should be able to open up the app and head over to Settings (gear icon at top right of main window) –> Updates, and click on the “Check Now” button (but make sure “Also check for pre-release (beta) versions of” is enabled!). For Microsoft Store users, you’ll need to install the Classic version to try this build out (I don’t yet have alpha/beta builds working for the Store). It can be installed side-by-side with the Store version and uninstalled when you’re done with it without affecting the Store copy.

Change log:

  • Fixed: Some images could not be saved as JPEG due to mishandling of some metadata
  • Fixed some error handling in the Save Configuration dialog. An error dialog will now pop up to show the exception that occurred in addition to the usual "Preview: (error)" text that has always been shown.
  • Fixed: HEIC/HEIF file extensions are now registered with Windows so that you can double-click on them in Explorer to open them in Paint.NET

Enjoy! :)

Advertisement 4.1.7 alpha build 7077 is now available

To download, head on over to the forum. I’m also in the process of adding this to the auto-updater.

This build has two big things going for it: 1) fixes to the Save Configuration dialog (sorta), and 2) some absolutely massive performance fixes to the main rendering engine when working with very large images.

Save Configuration dialog: Some folks have reported that they can’t get the Preview to work, even though saving and loading works fine. I don’t have a fix for this yet (AFAIK), but at least you’ll be able to see what the actual error is now so that you can send it to me. It will show up in the standard error dialog along with the almost useless "Preview: (error)" text that displays at the top.

Rendering engine: Before this update, Paint.NET has been very bad about handling very large images. I’m talking images that are on the order of 32,000 pixels large on either dimension (width or height). Zooming and panning often result in very long delays where the app just hangs until it figures itself out — and we’re talking 30, maybe even 60, seconds, even with a $1000 CPU like an overclocked Intel Core i9-7900X. I spent the last week optimizing this and replacing the data structures and work queue management code, and now this should all be working good. It’s not 60 FPS, so there’s still some work left when the time comes for it, but it’s very usable now! The worst delays might be on the order of 100-200ms, so they just feel like kind of a choppy framerate sometimes.

Changes since the previous alpha (build 7070):

  • Fixed: Optimized rendering engine to remove huge lag spikes (30+ seconds) when zooming or panning very large images (e.g. 32K x 32K pixels).
  • Improved: Added error reporting to the Save Configuration dialog. Instead of just saying "Preview: (error)", you’ll also get the standard error dialog that includes the exception which can used for troubleshooting.

Enjoy! Smile 4.1.7 alpha build 7070 is now available

Finally, a new build! :)

Edit: The title of this blog post originally incorrectly said build 7068. I’ve fixed it to say 7070. Everything else was correct. (The URL still has 7068 in it, oh well :))

To download, head over to the forum. (I’m also in the process of adding this to the auto-updater.)

I’ve spent a lot of time migrating all of the internal file types from GDI+ to WIC. This was a huge amount of code, but is a necessary infrastructure change for the long-term. GDI+ doesn’t work correctly to load “large” images, for instance — where “large” is actually any image that takes over 4GB of memory per layer (may even be limited to 2GB). There are a lot of other benefits, as well, such as having access to configure JPEG’s subsampling when saving.

Affected file types are PNG, JPEG, GIF, BMP, TIFF, and the newly added support for HEIF/HEIC (loading only, no saving). If you want to know where to get sample *.HEIC images, look no further than your iPhone :) Many Android phones should have support, too, but you’ll have to look it up for your particular make/model.

tl;dr for “what is HEIF: same quality as JPEG for half the file size. (IIRC) And a bunch of other stuff.

If you’re a fan of BMP, for some reason :), you’ll be happy to know you can now save and load with alpha (transparency). When I originally looked into this (like a decade ago?) I concluded it wasn’t possible, but several years later I now find out that WIC supports this natively. So, now it’s gladly supported

Note that due to a bug in WIC’s PNG decoder, file sizes over 4GB cannot be loaded. See my tweet for more info. In fact, PNGs larger than 2GB only work because I discovered a hacky workaround. Microsoft is currently looking into this and may have a fix soon (or like in Win10 v19H2 or something).

I’ve also done a bunch of refactoring and fixing to the Save Configuration dialog. It should be faster, more responsive, and use less memory. The flickering is now gone when you’re changing options. “More responsive” means that it should now start working on the newest option changes immediately instead of waiting for the previous computation to finish up (this is called “cancellation support” btw). This also allows the OK/Cancel buttons to avoid a long “Canceling…” or “Finishing…” dialog in most cases. This is a huge improvement when working with large images, or with file types that are computationally expensive to save (e.g. 8-bits with dithering, or TGA, or even just modestly large PNGs).

Developer / plugin enthusiast notes: Please note that the aforementioned cancellation support does require the FileType to either be 1) actively reading/writing with the Stream it’s given, and/or 2) actively reporting progress through its ProgressEventHandler. If the FileType does a whole bunch of calculations and then dumps out to disk, and never reports progress, then it’s still possible that changing options or clicking OK/Cancel will be sluggish or take awhile. The internal FileTypes should do a good job here, but plugins may or may not.

Changes since 4.1.6:

  • New: Support for loading HEIF/HEIC images (Windows 10 v1809+ required). Saving is not yet supported.
  • Improved: BMP now supports saving in 32-bit (with alpha!) and 8-bit indexed.
  • Improved: PNG and JPEG now supports loading and saving of much larger images.
  • Improved: JPEG now has configuration for subsampling mode (4:4:4, 4:2:2, and 4:2:0). The default is now 4:2:2 instead of the (unconfigurable) 4:2:0 of older versions.
  • Improved: TIFF now supports saving at 24- and 8-bit color depths.
  • Changed: Image->Resize supports Super Sampling again, and favors this over Fant when using Best Quality. Fant is still available, but is no longer chosen automatically.
  • Fixed: AltGr should now work correctly with the Text tool. It will not trigger shortcuts like File -> Save All, or Edit -> Paste into New Image. (thanks @Bruce Bowyer-Smyth for the fix!)
  • Fixed: Mouse cursors now scale appropriately for non-integer UI scales (e.g. 125% or 175%)
  • Fixed a number of performance issues in the Save Configuration dialog. Especially with large images, it should now be much faster to change options and to click OK/Cancel.
  • Fixed flickering in Save Configuration dialog when changing options.
  • Improved CPU usage for thumbnail updates (layers and image tabs) in many cases.
  • Improved performance of saving for file types where “Auto” bit-depth is supported but not the current choice.
  • Improved temporary memory usage when saving images at 8-bit color depth.
  • Fixed: Magic Wand now works on very large images (e.g. 65535 x 65535 pixels) without an error.
  • Fixed: DIBV5 bitmaps should now work with Edit->Paste, which improves alpha channel handling. (thanks @null54 for the fix!)
  • Fixed: Top-down DIBs should now work correctly with Edit->Paste. (thanks @null54 for the fix!)