Paint.NET 5.2 Alpha (build 9625)

Welcome to the first alpha for the 5.2 update! This new version is focused on performance, quality-of-life, and infrastructure improvements which prepare for the big 6.0 version that will be coming later. The two biggest changes are the new FileType plugin system and the rewritten high-precision layer rendering engine.

New FileType Plugin System

The original FileType plugin system dates back to 2005 with the v2.5 release. It has withstood the test of time in the sense that it still works and has provided a lot of value for a lot of people, but it has also noticeably aged poorly in ways that have prevented progress in other areas of the app. It was written at a time when .NET itself was just 3 years old and hitting its 2.0 release with generics and 64-bit support. The modern systems used in Paint.NET for component management and isolation were nowhere to be found back then. I had no clue that the project’s longevity would stretch so far into the future, nor that so many plugins would be developed!

The old FileType plugin system is tightly coupled with the Document, Layer, and Surface classes which Paint.NET also uses internally for UI and rendering purposes. They only support the 32-bit BGRA UI8 pixel format and a flat list of bitmap layers. The new FileType system works through interfaces such as IFileTypeDocument<TPixel> and ILayer<TPixel>, along with a rich and strongly-typed imaging framework providing support for a wide variety of pixel formats, pooled bitmap allocation, scaling/interpolation, quantization/dithering, format conversion, color management, and more.

Decoupling the FileType system from the internal classes means that these two systems can now evolve independently, and internal details can be abstracted away from plugins. The new plugin system has been designed to support versioning, meaning that functionality can be added or changed in the programming interfaces that are provided to plugins while maintaining compatibility for plugins that have already been published. New layer types and topologies (e.g. layer folders) can be added without breaking existing plugins, new blend modes can be introduced, and bitmap layers will finally be able to migrate to a tiled storage system.

Note to plugin authors: In general, plugins should provide pixel data in the image file’s original format without converting it to BGRA32. In other words, let Paint.NET handle the conversion, whether you’re supplying pixels as RGBA64, BGR24, or even an HDR format such as RGBA FP32. Paint.NET will figure out the best conversion for pixel format and color profile handling, and when expanded pixel format support is rolled out your plugin can automatically benefit from it. Note that plugins can also determine at runtime which pixel formats are supported and which are native, in case they do want to do the conversion themselves for whatever reason.

New Layer Rendering Engine

The old layer rendering engine has its roots going all the way back to the 1.0 release in 2004. Over the years it has migrated from C# to C for performance reasons, and then back to C# once the language and JIT had finally caught up to the performance of the native code. However, it has no SIMD optimizations, it only has 8 bits per channel of precision (“UI8”), and the code was very messy and difficult to make changes to. Working with many layers can result in incorrect colors or banding artifacts as off-by-1 errors accumulate across multiple layers. 

With 5.2, this has been completely rewritten and upgraded to use 32-bits of floating-point precision per channel (“FP32”). It is fully optimized for AVX2, AVX512, and even ARM64 NEON thanks to .NET’s new platform-agnostic intrinsics support. Because FP32 uses a lot more memory bandwidth than UI8, many tricks have been employed to cut down on that to the point that there is no perceptible performance reduction from previous versions (the old renderer not using any SIMD also helps this comparison). The bottleneck is compute, not memory bandwidth, and performance really shines on CPUs with AVX512 support even with standard dual channel memory.

A driving factor behind this change was to prepare for future versions of Paint.NET that will expand pixel format support beyond BGRA UI8. In order to do this in a sane and maintainable manner, having a canonical pixel format became important so that each rendering kernel only needs to be written once. All of the rendering kernels can now operate exclusively on FP32 data, with high-performance format conversion and color transform kernels at the beginning and end of the rendering pipeline. This will make it much easier to add support for RGBA UI16, RGBA FP16, and even RGBA FP32 — the layer rendering engine already supports it, the rest of the app just has to catch up.

What’s coming in 6.0?

This update will introduce a new .PDN file format that will finally enable the ability to add new features to the document and layering systems. High bit-depth pixel formats, new blend modes, and layer folders are planned to be the first use of these. Later on, features such as adjustment layers, text layers, and HDR will also be added (to name a few).

Change Log

Changes since 5.1.12:

  • New modernized FileType plugin system
    • Support for a wide variety of pixel formats. The classic BGRA32 is of course available, as well as RGBA64, CMYK, or even RGBA128Float (which will be more useful with upcoming HDR support).
    • Decoupled from the internal Document and Layer classes, thus affording flexibility for more comprehensive changes to the document and layer object model.
  • Rewritten layer rendering rendering engine.
    • Now uses 32-bit floating point (FP32) instead of 8-bit integers (UI8).
    • Much higher precision eliminates artifacts and incorrect colors that can result from the old low-precision 8-bit rendering code
    • Fully optimized for AVX2 and AVX512. Significant performance gains on systems with AVX512 support due to a high compute:memory ratio.
  • Renamed Edit -> Copy Merged to Edit -> Copy Flattened.
  • Improved copy-to-clipboard (Edit -> Copy and Edit -> Copy Flattened) performance by up to 95%. See also: https://x.com/rickbrewPDN/status/2039850858935140449
  • Reduced temporary memory usage by 50% for Edit -> Paste into New Image.
  • Paint Bucket and Color Picker now support holding Ctrl as a shortcut key for specifying Image sampling mode.
  • Substantial performance improvements for larger images. Fluidity of zooming and scrolling will be significantly better. A lot of lag and hitching has been eliminated.
  • Save Configuration dialog renamed to Save Options.
  • Fixed some cases of metadata not being preserved correctly.
    • PNG tEXt/iTXt metadata is now preserved, which includes prompt and parameter information for images generated by Stable Diffusion et. al.
    • Expanded and improved the imaging framework for plugins.
      • Better color management
      • New interpolation modes (BitmapInterpolationMode2)
      • Channel extraction and channel replacement. This makes it easier to work with a variety of non-standard pixel formats (e.g. Gray+Alpha) that do not have direct support in the imaging framework.
      • Support for generic 2-channel pixel formats (ColorGenericXY[16, 32, 32Half, 64Float]). These are meant to be used with the aforementioned channel extraction and replacement support.
      • Support for alpha formats beyond 8-bits: 16-bit integer, as well as 16- and 32-bit floating point.
      • Better CMYK pixel format support, which enables importing CMYK32, CMYKA40, CMYK64, and CMYKA80 images
    • Improved reliability of some GPU effects/adjustments on certain older or low-end systems.
    • Optimized the Median Blur effect by 10-50% depending on the selected quality value.
    • Optimized histogram calculation for Levels and Auto-Levels by about 20%.
    • Updated to use .NET 10
    • “Classic” (aka legacy) effect plugin system is now fully deprecated. Old plugins will still continue to work forever, but new ones can no longer be compiled.
    • Updated bundled AVIF FileType plugin to use the new FileType plugin system.
    • Updated bundled DDS FileType Plus plugin to use the new FileType plugin system.
      • The Save Options dialog will now auto-select the DDS format that the original file was encoded with if it was also a DDS file.
    • Updated bundled JPEG XL FileType plugin to use the new FileType plugin system.
    • Updated bundled WebP FileType plugin to use the new FileType plugin system.
    • Converted the SetupDownloader EXE from C# to C++, thus eliminating the last dependency on .NET Framework 4.8. This executable is used for the small “Any CPU” / “Web” installer.
    • Fixed a scaling issue with the “compass” mouse cursor used by various tools (Move, Shapes).
    • Fixed an uncommon cosmetic glitch with the selection outline when the selection quality is set to “pixelated”
    • Fixed an ultra-rare hang that could happen after opening an image or when the “Committing changes” progress bar was at 70%.

    Download and Install

    This build is available via the built-in updater as long as you have opted-in to pre-release updates. From within Settings -> Updates, enable “Also check for pre-release (beta) versions of paint.net” and then click on the Check Now button. You can also use the links below to download an offline installer or portable ZIP.

    You can also download the installer here (for any supported CPU and OS), which is also where you can find downloads for offline installers, portable ZIPs, and deployable MSIs.