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.

    Paint.NET 5.1.5 Beta (build 9191)

    This update adds JPEG XL (*.jxl) support, improves quantization color quality, updates AVIF loading to better handle mapping HDR images to SDR, and fixes some bugs.

    Change Log

    Changes since 5.1.4:

    • New: JPEG XL (*.jxl) images are now supported by way of bundling @null54‘s JpegXLFileType plugin
    • Fixed the Levels adjustment not honoring the active selection.
    • Fixed some more mouse cursor issues when completing certain actions with certain tools.
    • Fixed some keyboard shortcuts in the Adjustments menu not working reliably.
    • Fixed most cases of tooltips blinking on/off when drawn near the bottom of the screen (thanks @toe_head2001!).
    • Fixed some new high-DPI scaling issues in toolbar dropdowns.
    • Improved quantization quality for Effects->Color-Quantize and when saving an image at 8-bit depth and below. This was done by merging octree node colors in linear gamma space.
    • Fixed some incorrect background text color rendering in the status bar.
    • Updated the bundled AvifFileType plugin to v3.12.0, which improves conversion from HDR images utilizing the Rec. 2020 PQ color space (thanks @null54!).
    • Updated the bundled WebpFileType plugin to v1.5.0 (thanks @null54!).

    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.

    Paint.NET 5.1.4 is now available

    This update is mostly a hotfix that fixes installation on Windows Server systems.

    Get the Update

    There are two releases of Paint.NET:

    • Microsoft Store release (recommended)
      • You can purchase it here. This helps fund development and is an alternative or supplement to sending in a donation. In addition, updates happen automatically in the background when you’re not using the app.
      • If you already have it installed, the update should happen automatically once Microsoft certifies the update, usually within the next day or so. To get the update immediately (once it’s certified), you can follow the instructions listed here.
    • Classic Desktop release
      • Download the installer from the website. This is the recommended download if you don’t have Paint.NET installed. It can also be used to update the app.
      • If you already have it installed, you should be offered the update automatically within the next few days, but you can also get it immediately by going to ⚙ Settings -> Updates -> Check Now.
      • Offline Installers and Portable ZIPs are available over on GitHub.

    Change Log

    Changes since 5.1.3:

    • Fixed: Installation on Windows Server will no longer fail with an error about a missing srclient DLL.
    • Improved: When saving an image fails due to Windows Defender’s “Controlled Folder Access” setting, the error message will mention that instead of being a generic “I/O failure” message.
    • New: GIF Comment metadata is now preserved. It maps to EXIF Photo.UserComment tags.
    • Improved: Consolidated the number of threads used for Async Present from 3 per image (canvas, left ruler, top ruler) to 3 total.
    • Improved: ColorManagementEffect now supports DxgiColorSpace color contexts (for plugin developers).

      Paint.NET 5.1.3 Beta (build 9168)

      This is a maintenance release with a big heaping of performance improvements, bug fixes, and other small changes.

      Change Log

      Changes since 5.1.2:

      • Fixed: Some PNG metadata from text chunks is now preserved (Author, Comment, Copyright, and Description).
      • Fixed some issues with snapping tool window when there are multiple monitors with different scaling levels. Sometimes the snapping boundaries would be calculated in the wrong coordinate space and cause snapping to happen at seemingly arbitrary (and weird) locations.
      • Fixed an off-by-1 error in the Median Blur effect that was producing incorrect results, especially with radius=1
      • Fixed a crash in the Levels adjustment’s UI due to some improper value clamping.
      • Fixed the Red Eye Removal effect so it no longer crashes if the canvas zoom level does not show the whole image.
      • Fixed the Red Eye Removal effect so that it properly clips to the active selection.
      • Fixed: View -> Zoom to Selection no longer adjusts the zoom level slightly if used twice in a row.
      • Improved: The Color properties for the Clouds effect now have Reset buttons, which will reset them to the current Primary and Secondary colors.
      • Fixed some issues with the mouse cursor briefly being a generic arrow instead of the tool’s requested cursor.
      • Fixed: The installer will no longer silently die on Windows 10 pre-v21H2. It will now correctly show an error message stating that Windows 10 v21H2 is required, and the exit code will be ERROR_OLD_WIN_VERSION.
      • Improved framerate and responsiveness of the canvas when using CPU- or GPU-intensive tools such as Move Selected Pixels
      • Substantially improved UI responsiveness when modifying a complex selection with a combine mode other than Replace
      • Fixed: Tooltips now respect dark mode (thanks @toe_head2001!)
      • Fixed: The Text tool’s “Sharp (Modern)” rendering mode has been reverted to use Natural Symmetric rendering instead of Natural Symmetric Downsampled. (See discussion here. cc @Leahsarah)
      • Reduced the performance cost of the circle “preview cursor” that all of the brush tools use.
      • New: HlslUnaryFunctionEffect (for GPU effect plugin developers) now has FrexpMantissaPortion, FrexpExponentPortion, ModfIntegerPortion, and ModfFractionalPortion. These provide access to the Frexp and Modf HLSL instructions.
      • New: Plugins may now implement custom DirectWrite IInlineObjects.
      • New: IEffectConfigForm.Close() is now public, and may be used by plugins that are hosting other effects via IEffectsService2.
      • New: Added an accelerator key for Image -> Rotate 90° Counter-clockwise.
      • New: Added accelerator keys to the View menu for the Inches, Centimeters, and Pixels choices.
      • Changed to use the Windows threadpool instead of the .NET portable threadpool.

      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.

      Paint.NET 5.1.2 is now available

      This update fixes some small bugs, including flickering issues with NVIDIA Fast VSync, and should further soothe the screen blanking issues being reported on some systems with buggy MPO (multiplane overlay) support.

      Get the Update

      There are two releases of Paint.NET:

      • Microsoft Store release (recommended)
        • You can purchase it here. This helps fund development and is an alternative or supplement to sending in a donation. In addition, updates happen automatically in the background when you’re not using the app.
        • If you already have it installed, the update should happen automatically once Microsoft certifies the update, usually within the next day or so. To get the update immediately (once it’s certified), you can follow the instructions listed here.
      • Classic Desktop release
        • Download the installer from the website. This is the recommended download if you don’t have Paint.NET installed. It can also be used to update the app.
        • If you already have it installed, you should be offered the update automatically within the next few days, but you can also get it immediately by going to ⚙ Settings -> Updates -> Check Now.
        • Offline Installers and Portable ZIPs are available over on GitHub.

      Change Log

      Changes since 5.1.1:

      • Improved (reduced) CPU and GPU usage of the canvas, which leaves more CPU time for things like input processing. This was done by enabling VSync while also utilizing the DXGI Frame Latency Waitable Handle to minimize latency.
      • Fixed some screen blanking issues for some systems that have buggy MPO (multiplane overlay) support.
      • Fixed flickering and mouse trails for systems that have NVIDIA Fast VSync enabled (NVIDIA driver bug).
      • Fixed a hang while making changes to the Transparency Checkerboard Brightness setting when certain legacy plugins are installed.
      • Fixed a crash in the Levels adjustment UI if it was canceled or closed too quickly.
      • Added a /diagnostics command-line parameter that shows the diagnostics info without having to start up the whole app.
      • Added convenience constructors to most of Direct2D’s built-in effects (for GPU effect plugin authors).
      • Added a PrimitiveBlendEffect for GPU effect plugins. This wraps ID2D1BlendTransform which is normally only available for use within the transform graph of a custom effect.
      • Added ability for plugins to work with CMYK (PixelFormats.Cmyk32/64 and ColorCmyk32/64 structs)
      • Updated the DDS FileType Plus plugin to v1.12.12.0 (thanks @null54!)

      Paint.NET 5.1.2 Beta (build 9118)

      This update fixes some bugs across the app and should further soothe the screen blanking and visual artifacts on systems with buggy MPO (multiplane overlay) support.

      Change Log

      Changes since 5.1.1:

      • Improved (reduced) CPU and GPU usage of the canvas, which leaves more CPU time for things like input processing. This was done by enabling VSync while also utilizing the DXGI Frame Latency Waitable Handle to minimize latency.
      • Fixed some visual issues, such as screen blanking and flickering, for some systems that have buggy MPO (multiplane overlay) support.
      • Fixed a hang while making changes to the Transparency Checkerboard Brightness setting when certain legacy plugins are installed.
      • Fixed a crash in the Levels adjustment UI if it was canceled or closed too quickly.
      • Added a /diagnostics command-line parameter that shows the diagnostics info without having to start up the whole app.
      • Added convenience constructors to most of Direct2D’s built-in effects (for GPU effect plugin authors).
      • Added a PrimitiveBlendEffect for GPU effect plugins. This wraps ID2D1BlendTransform which is normally only available for use within the transform graph of a custom effect.
      • Added ability for plugins to work with CMYK (PixelFormats.Cmyk32/64 and ColorCmyk32/64 structs)
      • Updated the DDS FileType Plus plugin to v1.12.12.0 (thanks @null54!)

      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.

      Paint.NET 5.1.1 is now available

      This is a small update that contains fixes for some bugs and that were discovered in 5.1, as well as a new Fill option in the Image -> Canvas Size dialog. It also has workarounds for some bugs in Sentinel One (antivirus) that were causing crashes in the installer and hangs during app startup.

      Get the Update

      There are two releases of Paint.NET:

      • Microsoft Store release (recommended)
        • You can purchase it here. This helps fund development and is an alternative or supplement to sending in a donation. In addition, updates happen automatically in the background when you’re not using the app.
        • If you already have it installed, the update should happen automatically once Microsoft certifies the update, usually within the next day or so. To get the update immediately (once it’s certified), you can follow the instructions listed here.
      • Classic Desktop release
        • Download the installer from the website. This is the recommended download if you don’t have Paint.NET installed. It can also be used to update the app.
        • If you already have it installed, you should be offered the update automatically within the next few days, but you can also get it immediately by going to ⚙ Settings -> Updates -> Check Now.
        • Offline Installers and Portable ZIPs are available over on GitHub.

      Change Log

      Changes since 5.1:

      • Added the ability to choose the fill color when expanding the image with Image->Canvas Size
      • Fixed the ability to paste images with transparency from Firefox
      • Fixed the ability to paste certain types of images with transparency from Microsoft Office applications
      • Changed Edit->Cut and Edit->Crop to Selection to completely zero out pixels outside of the selected area, which could otherwise be a privacy issue.
      • Fixed the inability to load an image with a bad ICC color profile. The color profile will now be ignored and the image will be treated as if it had an sRGB color profile.
      • Fixed the titlebar text being drawn in the active text color when the window is not active when using Light or Blue themes
      • Reverted the removal of the Settings checkbox that lets you disable overscroll
      • Fixed a crash in the Levels adjustment UI due to a rounding error
      • Fixed a race condition in resource loading that sometimes caused the zoom level in the status bar to display as “ScaleFactor.Percentage.Format”
      • Fixed some graphical corruption, hang, or crash issues caused by Nahimic A-Volute malware
      • Worked around a crash (“0xc000007b”) in the installer caused by Sentinel One antivirus.
      • Worked around a hang at app startup if Sentinel One antivirus.
      • Fixed many cases of screen blanking, rendering glitches, and crashes on systems with certain NVIDIA GeForce GPUs, and certain displays with support for overlays and/or VRR (FreeSync, GSYNC). This appears to be a bug in NVIDIA’s driver.
      • Fixed effects calling Dispose() on the IServiceProvider when they shouldn’t have been. This affected plugins like CodeLab and Plugin Browser.
      • Updated the bundled AVIF FileType to version 3.11.0.0 (thanks @null54!)

      Paint.NET 5.1.1 Beta (build 9103)

      This fix will hopefully further soothe the issues some have been reporting with blanking screens and GPU crashes.

      After a multi-day investigation involving performance profiling and discussions with some subject matter experts (DirectX Discord Server), I believe what’s happening is a result of multi-plane outputs (MPOs, aka overlays) intersecting with VRR (variable refresh rate, FreeSync, GSYNC) and PDN’s use of multiple on-screen flip-model swapchains. Each swapchain was rendering unthrottled, and they were not synchronized.

      The solution, I’m hoping, is that I’ve applied VSync to everything except the canvas. Only the canvas is latency sensitive enough to warrant using an unthrottled framerate (akin to NVIDIA’s “Fast VSync”).

      The screen blanking issue appears to be a bug in NVIDIA’s GPU driver, but may also be a bug in the firmware of some displays. I have not yet been able to test this on an AMD GPU to see if it happens there, but I’m planning to do that next.

      Change Log

      Changes since 5.1.1 Beta (build 9102):

      • Improved (hopefully fixed) the screen blanking issue that is happening mostly on systems with NVIDIA GeForce GPUs on displays with high refresh rates and/or VRR support (GSYNC/FreeSync)

      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.

      Paint.NET 5.1.1 Beta (build 9102)

      This beta build has some more fixes, particularly for systems with NVIDIA GSYNC enabled.

      Change Log

      Changes since 5.1.1 Beta (build 9098):

      • Fixed Edit->Cut and Edit->Crop to Selection not zeroing out transparent pixels, which could be a privacy issue.
      • Fixed swapchain valid rect propagation, which may fix some cases of flickering or trails that have been reported.
      • Fixed some crashes and blanking screen issues related to GSYNC/FreeSync/VRR on some NVIDIA GPUs. The NVAPI profile was not being created which caused VRR to still be active for the app. This also appears to be a bug in NVIDIA’s GPU driver.

      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.

      Paint.NET 5.1.1 Beta (build 9098)

      NOTE: I forgot to post 5.1.1 Beta (build 9093) to the blog. See the forum post here for information about the fixes in that build.

      This beta build has some more fixes, particular in the way of workarounds for the crash and hang on systems with Sentinel One antivirus.

      Change Log

      Changes since 5.1.1 Beta (build 9093):

      • Fixed the inability to load an image with a bad ICC color profile. The color profile will now be ignored and the image will be treated as if it had an sRGB color profile.
      • Fixed the crash in the “anycpu” installer if Sentinel One is installed (“0xc000007b”).
      • Fixed the hang at app startup if Sentinel One is installed. If S1 is detected then Async Present will be disabled, which negatively affects input latency/lag (it won’t be worse than PDN 5.0). This is temporary until Sentinel One itself is fixed.
      • Fixed (maybe/hopefully) some rendering glitches on some systems. Symptoms include mouse trails and a flickering canvas. This was done by disabling swapchain valid rect propagation, which did not seem to be working anyway. The /disableSwapChainValidRectPropagation command-line parameter has been removed as a result.
      • Added the /disableSwapChainPresent1 command-line parameter for troubleshooting purposes (will be removed in a future version).

      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.