Paint.NET 5.2 Beta (build 9762)

Welcome to the first beta for the 5.2 update! This new version has new effects and also has a big focus 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. There are also 8 new effects and very experimental support for running on Wine (Linux/Mac), which we’ll get to later.

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 can finally be migrated 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 FP16. 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 query 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 .NET’s JIT had finally caught up to (and surpassed!) the performance of the native C compiler’s code generation. 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 optimize 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 (e.g. AMD Zen 5) 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 application-level 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.

New Effects

This release adds 8 new effects. These fill in the Artistic submenu, add some new dithering capabilities, two new distortion effects, and finally support for high-quality halftoning.

  • Artistic -> Linocut
    • Simulates a relief printmaking technique where an artist carves an image into a sheet of linoleum, rolls ink onto the raised surface, and then stamps it onto paper or fabric.
  • Artistic -> Mosaic
    • This is sort of like an expanded Pixelate effect with optional beveling and grout separation between the “pixels.” There are numerous tiling patterns to choose from.
  • Artistic -> Pointilism
    • Simulates a painting technique where an artist applies small, distinct dots of color next to each other to form an image.
  • Artistic -> Stained Glass
    • Simulates stained glass. Similar to Distort->Crystalize, but more fleshed out.
  • Color -> Ordered Dither
    • Simple ordered dithering patterns from the Bayer, Spiral, Dual Spiral, Blue Noise, and White Noise families.
  • Distort -> Spherize
    • Similar to Distort -> Bulge, but produces an actual spherical shape.
  • Distort -> Waves
    • A very configurable effect that can produce waves, ripples, spirals, flowers, and other shapes.
  • Stylize -> Halftone
    • Simulates physical printing, such as seen in newspapers or comic books, using either CMYK or black-and-white dots. The conversions between RGB and CMYK are color space aware and operate in linear gamma space when appropriate, resulting in a very high quality result.

Examples of each new effect:

Original
image.png
Linocut
image.png
Mosaic
image.png

Pointilism
image.png
Stained Glass
image.png
Ordered Dither
image.png

Spherize
image.png
Waves
image.png
Halftone
image.png

Experimental Wine Support

NOTE: This is not for the faint of heart! It is very much experimental and targeted towards early adopters who aren’t afraid of missing functionality, performance issues, crashes, and wrestling with dependencies.

I’ve recently made major progress getting Paint.NET working on top of Wine, which means Paint.NET can now finally run on Linux and Mac. This was first made available as part of 5.2 Alpha (build 9739) and has now been moved into its own package that you can download from a separate GitHub page with its own Releases page and Issues tracker. Updates will be independent(-ish) of the main Windows packages, at least for the foreseeable future. Each new Windows release will be accompanied by a corresponding Wine release so that it doesn’t fall behind in functionality.

What’s coming in 6.0?

The next big 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 this. Later on, features such as adjustment layers, text layers, and HDR are also planned (to name just a few).

Change Log

Changes since 5.2 Alpha (build 9739) (sorry, I forgot to cross-post it to the blog):

  • New: The Eraser tool now supports selecting a Fill pattern in the toolbar.
  • Improved: When using Image->Resize and “Maintain aspect ratio”, the rounding has been improved to reduce the aspect ratio error
  • Fixed a bug in the Move tools where shift-clicking on a side handle (north/south/east/west) would sometimes cause it to move on its own by 1-2 pixels.
  • Fixed: The Colors window will no longer erase the hex field if an invalid character is typed.
  • Fixed the tooltips in the File -> Open Recent menu by removing them (WinForms is just very buggy here). The directory paths are now shown on a second line of text instead.
  • Renamed the “Move Selected Pixels” tool to “Move Pixels.”
  • Fixed an SEHException error message when changing the language.
  • Experimental Wine support is now in a separate package that is updated independently(-ish) of the main package. You can get it here: https://github.com/paintdotnet/Paint.NET-on-Wine
  • Updated the DDS FileType Plus bundled plugin. The Save Options dialog will now auto-check or auto-uncheck the checkboxes for enabling mipmaps or cube maps if the image was originally opened from a DDS file.

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.

image.png

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.

For the experimental builds for Wine, you can go here to download them.