paint.net 4.2.16 beta build 7765

Now that I’m getting back into the swing of things after having moved across the country (Bay Area -> back to Seattle area, finally!), it’s time for a new update :)

This release is mostly focused on fixing, improving, and optimizing the quantization code. This is used when you save an image at 8-bit or lower color depth. There have been a number of bugs that have plagued this over the years, including 1) the generated palette is way too small (e.g. for a black->red gradient, it’d be 64 colors instead of 256), 2) the generated palette is slightly too small (e.g. 252 colors instead of 256), 3) the precision of the colors would be biased in favor of those that are at the top of the image, 4) the palette has colors removed from it that shouldn’t have been (this plagues Auto-detect), and more recently 5) the generated palette, especially for a low color depth, is complete trash.

#1 was a result of a bug in the Octree code that goes all the way back to the MSDN article it was pulled from, https://docs.microsoft.com/en-us/previous-versions/dotnet/articles/aa479306(v=msdn.10)?redirectedfrom=MSDN . As it turns out, shifting right (via >>) by a negative amount results in 0 instead of a shift left. Maybe C works that way, but C# does not.

#2 was a result of the way that reduction/merging works in the Octree data structure. It can only merge an entire node’s children, meaning it can reduce 8 colors into 1, but never 8 colors into 2 through 7. This means it would undershoot the desired palette size as much as 6/7th of the time. I fixed that with a trick I learned at https://www.codeproject.com/Articles/109133/Octree-Color-Palette (search for the word "vomit" ).

#3 happens because the Octree code would reduce nodes in an order defined by how they were added to the octree. Since the image is processed top-to-bottom, this would thus favor colors that first appear at the top. I’ve fixed this by more evenly spreading out which leaf nodes are merged — those with lower frequencies are merged first, and if two colors have the same frequency then the ordering is deterministically pseudo-randomized by using the color’s hash code.

#4 was kind of a mix between 1, 2, and 5. There have been several reports of images that should be correctly auto-saving at 4-bit color depth (because of using <=16 colors), but colors are still trimmed. Auto-detect is strictly required to be lossless, and it has been failing at that. My new code for the Octree algorithm should fix this, but I’ve also added code to skip palette generation entirely if the desired color count is greater than the # of unique colors in the image (an obvious shortcut/fix, but the code was a bit snaky in terms of permitting this). This also means Median Cut will behave properly, because WIC’s code does not necessarily do this correctly either.

#5 was a result of switching from my Octree code to WIC’s Median Cut. As it turns out, Median Cut isn’t a good choice for a lot of images even when it’s correctly implemented. In addition to having some really bad bugs with large images that I’ve had to work around, WIC’s implementation also falls completely flat on its face when the palette size is small. Imagine a black->white gradient that gets bits of cyan and magenta sprinkled throughout. Ugh. I have retained the ability to use Median Cut, although Octree is the default.

I’ve also optimized these things to be a lot faster and use a lot less memory.

You can see all of this in effect if you save an image as a PNG, GIF, TIFF, or BMP at 8-bit, 4-bit, 2-bit, or 1-bit color depth. You can also use the new Effect -> Color -> Quantize effect to play around with it. It lets you specify an exact palette size instead of the bit-depth.

image.png

To get this update, make sure you have "Also check for pre-release (beta) versions" enabled in Settings, and then click on the Check Now button. (Unfortunately alpha/beta releases are not currently available for the Microsoft Store version of the app).

image.png

You can also download and install this build directly on the forum.

Change log:

  • New: Effect -> Color -> Quantize, which applies palette reduction to 256 colors or less, along with dithering. This is the same algorithm used when saving images at 8-bit color depth or lower.
  • Fixed and improved palette generation when saving at 8-bit color depth or less
  • Greatly optimized performance of palette generation and image quantization
  • Added option to choose between Octree (default) and Median Cut algorithms for palette quantization when saving at 8-bit color depth or less
  • Fixed a crash in Move tools when the selection was 0-width and/or 0-height
  • Added tooltips w/ shortcut keys to the Tools dropdown in the toolbar
  • Fixed IndirectUI ColorWheel rendering (thanks @toe_head2001!)
  • Fixed a crash in the Text tool when using Ctrl+(Left,Right,Backspace,Delete) (thanks @Bruce Bowyer-Smyth!)
  • Changed: New layers are now filled with #00000000 instead of #00FFFFFF
  • Fixed a crash when working with selections (OutOfMemoryException)
  • New: Effects can now access the Document’s DPI via EffectEnvironmentParameters.DocumentResolution
  • Fixed drawing of the color palette in the Colors window when using some non-standard DPI scaling settings (e.g. 1.15x)
  • Fixed a crash when using EdHarvey’s Threshold plugin
  • Fixed the return value from PdnRegion.GetBoundsInt() so it’s not anchored at (0,0) unless it should be
  • Fixed premultiplied-to-straight color conversion on some code paths (thanks @null54!)
  • Updated bundled AvifFileType plugin to v1.1.11.0, which includes performance optimizations and bug fixes. See its GitHub releases page for more info.

paint.net 4.2.15 is now available

This is a small update that improves some quality-of-life issues, and fixes some important crashes due to mishandling of some non-fatal DirectX errors.

If you’re using the Windows Store release, you should get the update automatically within the next 24 hours. You can also force an update check by following these instructions.

For the Classic release, you should be offered the update automatically within the next week or so. You can get the update sooner by going to ⚙ Settings → Updates → Check Now. You can also download and install it directly from the website.

List of changes since 4.2.14:

  • New: "Tolerance Alpha Mode" toggle button added to the toolbar for the Magic Wand, Paint Bucket, and Recolor tools. This permits switching the algorithm for color comparison between premultiplied (default) and straight. "Straight" will distinguish between transparent pixels with different color values, whereas premultiplied will see them as equivalent.
  • New: Holding Ctrl while using the Color Picker tool will sample from the merged image (vs. just the current layer)
  • New: The file name in the title bar will now have a prepended asterisk when it has unsaved changes
  • Changed: The image close ‘X’ button can now be clicked for images that are not currently active
  • Changed: In the Text tool, Ctrl+(Backspace, Delete, Arrow Keys) has been improved to work more like Microsoft Word. Thanks to @Bruce Bowyer-Smyth for the patch!
  • Fixed: The Rectangle Select tool, when used to draw a constrained, fixed ratio, or fixed size selection, will now correctly clamp the rectangle to be within the canvas
  • Fixed: Layers -> Move Layer Up/Down/Top/Bottom was not working for images with fewer than 3 layers
  • Fixed: Edit -> Erase Selection will now fill with transparent black (#00000000) instead of transparent white (#00FFFFFF)
  • Fixed: Custom Shapes will now be displayed in a consistently sorted order
  • Fixed: ".pdnSave" ghost files should no longer linger when saving to the desktop. This was due to a bug in Windows and File Explorer.
  • Fixed crashes due to DXGI/Direct3D "lost device" or "device removed" errors that can happen for various reasons (duck/undock, driver update, low memory, etc.)
  • New: Plugins can now use the IArrayPoolService, a wrapper around .NET’s ArrayPool, to optimize their array allocations
  • Updated bundled AVIF FileType Plus to v1.1.6. See the pdn-avif releases page on GitHub (https://github.com/0xC0000054/pdn-avif/releases) for more information.

Enjoy!

paint.net 4.2.15 beta build 7690

This release is going pretty smoothly! I just had to fix a few small things that were pointed out in the forum thread for the alpha release, and get the translations up-to-date.

To get this update, make sure you have "Also check for pre-release (beta) versions" enabled in Settings, and then click on the Check Now button. (Unfortunately alpha/beta releases are not currently available for the Microsoft Store version of the app).

image.png

You can also download and install this build directly on the forum.

Changes since 4.2.15 alpha build 7683:

paint.net 4.2.15 alpha build 7683

This is a small update that improves some quality-of-life issues, and fixes some important crashes due to mishandling of some non-fatal DirectX errors.

To get this update, make sure you have "Also check for pre-release (beta) versions" enabled in Settings, and then click on the Check Now button. (Unfortunately alpha/beta releases are not currently available for the Microsoft Store version of the app).

image.png

You can also download and install this build directly on the forum.

Changes since 4.2.14:

  • New: "Tolerance Alpha Mode" toggle button added to the toolbar for the Magic Wand, Paint Bucket, and Recolor tools. This permits switching the algorithm for color comparison between premultiplied (default) and straight. "Straight" will distinguish between transparent pixels with different color values, whereas premultiplied will see them as equivalent.
  • New: Holding Ctrl while using the Color Picker tool will sample from the merged image (vs. just the current layer)
  • New: The file name in the title bar will now have a prepended asterisk when it has unsaved changes
  • Changed: The image close ‘X’ button can now be clicked for images that are not currently active
  • Fixed: The Rectangle Select tool, when used to draw a constrained, fixed ratio, or fixed size selection, will now correctly clamp the rectangle to be within the canvas
  • Fixed: Layers -> Move Layer Up/Down/Top/Bottom was not working for images with fewer than 3 layers
  • Fixed: Edit -> Erase Selection will now fill with transparent black (#00000000) instead of transparent white (#00FFFFFF)
  • Fixed: Custom Shapes will now be displayed in a consistently sorted order
  • Fixed: ".pdnSave" ghost files should no longer linger when saving to the desktop. This was due to a bug in Windows and File Explorer.
  • Fixed crashes due to DXGI/Direct3D "lost device" or "device removed" errors that can happen for various reasons (dock/undock, driver update, low memory, etc.)
  • New: Plugins can now use the IArrayPoolService, a wrapper around .NET’s ArrayPool, to optimize their array allocations
  • Updated bundled AVIF FileType to v1.1.6. See the pdn-avif releases page on GitHub (https://github.com/0xC0000054/pdn-avif/releases) for more information.

Enjoy!

paint.net 4.2.14 is now available

(Forum discussion here)

This update includes full support for AV1 (*.avif) images, courtesy of @null54‘s AvifFileType plugin, which is now bundled.

In addition, I’ve spent a lot of time optimizing various parts of the canvas rendering engine. Memory usage and CPU usage are both lower across the board, which should help when working with large images, as well as images (large or small) with many layers. I’ve also made several bug fixes and improvements to the Move Selected Pixels, Magic Wand, Paint Bucket, and Ellipse Select tools.

If you’re using the Windows Store release, you should get the update automatically within the next 24 hours. You can also force an update check by following these instructions.

For the Classic release, you should be offered the update automatically within the next week or so. You can get the update sooner by going to ⚙ Settings → Updates → Check Now. You can also download and install it directly from the website.

Changes since 4.2.13:

  • New: AV1 (*.avif) images can now be saved (not just opened), due to bundling of @null54‘s AvifFileType plugin (v1.1.4.0). Installation of Microsoft’s codec from the Microsoft Store is no longer necessary, which means this also works on Windows 7 and 8.1.
  • Improved performance and memory usage in the canvas rendering engine, especially when working with large images or images with many layers. This is most noticeable when scrolling and zooming.
  • Improved CPU usage when a selection is active and when GPU accelerated rendering is disabled
  • Improved CPU/GPU usage when a selection is active but the app is not (the animation is disabled)
  • Reduced memory usage when working with images that have regions of solid color
  • Fixed the Magic Wand and Paint Bucket tools so that they do calculations in the premultiplied alpha color space. This ensures that transparent colors (alpha=0) with different RGB values are treated as equal, and do not create borders.
  • Fixed the Move Selected Pixels tool so that it fills the uncovered region with 0 (transparent), instead of a transparent version of the secondary color.
  • Fixed: Backspace now works correctly in the Colors form: it does not execute Edit -> Fill Selection
  • Fixed an issue where saving an image at 4-bit color depth (usually pixel art) was using an incorrect palette (reduced color count/quality). This was due to a bug in Windows Imaging Component (WIC).
  • Greatly improved performance when saving images at 8-bit color depth
  • Fixed an issue where very large images (e.g. 50000 x 50000 px) couldn’t be saved at indexed bit-depths (8-bit or less) due to a bug in Windows Imaging Component (WIC). More information on the forum: https://forums.getpaint.net/topic/116950-error-when-saving-a-big-file/
  • Fixed an issue where BMP images couldn’t be loaded if they had the .PNG extension (there’s an Android screenshot utility out there which does this …)
  • Improved: Ellipse Selection Tool’s now tessellates at a higher resolution, resulting in smoother circles at small sizes
  • Fixed a rare crash in the Gradient tool (“The tool must be in the Drawing state …”)
  • New: Added a list of the DLLs that are loaded into the process on the Settings → Diagnostics page. This is to help troubleshooting scenarios.
  • Fixed an issue with copying large images to the clipboard: if an image would take up more than 4GB, it could not be copied because the DIB and DIBV5 formats cannot be larger than that. Now, the DIB and DIBV5 formats are not placed on the clipboard if this happens.
  • Fixed an issue with Effect plugin tooltips which was preventing the menu item from being easily clicked (thanks @toe_head2001 for the fix!)
  • Fixed an issue that was preventing Effect configuration dialogs from working correctly in the Visual Studio designer (thanks @toe_head2001 for the fix!)
  • Added diagnostics information to most error dialogs. This is to help with troubleshooting.
  • Fixed: Scanning will now apply the DPI (resolution) from the scanner to the image, if possible
  • Updated bundled DdsFileTypePlus plugin to v1.10.7.0. See the pdn-ddsfiletype-plus change log on GitHub for more information. Thanks @null54!

Enjoy!

paint.net 4.2.14 beta build 7574

This build fixes a crash that was seen when using Effect plugins with 8-bit indexed icons, such as @dpy‘s AA Assistant. It also updates the bundled AVIFFileType to 1.1.1.0, which greatly improves memory usage and fixes a crash.

To get this update, make sure you have "Also check for pre-release (beta) versions" enabled in Settings, and then click on the Check Now button. (Unfortunately alpha/beta releases are not currently available for the Microsoft Store version of the app).

image.png

You can also download and install this build directly at the forum.

Changes since 4.2.14 beta build 7573:

  • Fixed a crash when using Effects that used 8-bit indexed icons
  • Updated bundled AvifFileType plugin to v1.1.1.0, which improves memory usage while saving and adds a "Very Slow" preset. See the pdn-avif change log on GitHub for more information. Thanks @null54!

Complete list of changes since 4.2.13:

  • New: AV1 (*.avif) images can now be saved (not just opened), due to bundling of @null54‘s AvifFileType plugin (v1.1.1.0). Installation of Microsoft’s codec from the Microsoft Store is no longer necessary, which means this also works on Windows 7 and 8.1.
  • Improved performance and memory usage in the canvas rendering engine, especially when working with large images or images with many layers. This is most noticeable when scrolling and zooming.
  • Improved CPU usage when a selection is active and when GPU accelerated rendering is disabled
  • Reduced memory usage when working with images that have regions of solid color
  • Fixed the Magic Wand and Paint Bucket tools so that they do calculations in the premultiplied alpha color space. This ensures that transparent colors (alpha=0) with different RGB values are treated as equal, and do not create borders.
  • Fixed the Move Selected Pixels tool so that it fills the uncovered region with 0 (transparent), instead of a transparent version of the secondary color.
  • Fixed: Backspace now works correctly in the Colors form: it does not execute Edit -> Fill Selection
  • Fixed an issue where saving an image at 4-bit color depth (usually pixel art) was using an incorrect palette (reduced color count/quality). This was due to a bug in Windows Imaging Component (WIC).
  • Greatly improved performance when saving images at 8-bit color depth
  • Fixed an issue where very large images (e.g. 50000 x 50000 px) couldn’t be saved at indexed bit-depths (8-bit or less) due to a bug in Windows Imaging Component (WIC). More information on the forum: https://forums.getpaint.net/topic/116950-error-when-saving-a-big-file/
  • Fixed an issue where BMP images couldn’t be loaded if they had the .PNG extension (there’s an Android screenshot utility out there which does this …)
  • Improved: Ellipse Selection Tool’s now tessellates at a higher resolution, resulting in smoother circles at small sizes
  • Fixed a rare crash in the Gradient tool ("The tool must be in the Drawing state …")
  • New: Added a list of the DLLs that are loaded into the process on the Settings → Diagnostics page. This is to help troubleshooting scenarios.
  • Fixed an issue with copying large images to the clipboard: if an image would take up more than 4GB, it could not be copied because the DIB and DIBV5 formats cannot be larger than that. Now, the DIB and DIBV5 formats are not placed on the clipboard if this happens.
  • Fixed an issue with Effect plugin tooltips which was preventing the menu item from being easily clicked (thanks @toe_head2001 for the fix!)
  • Fixed an issue that was preventing Effect configuration dialogs from working correctly in the Visual Studio designer (thanks @toe_head2001 for the fix!)
  • Added diagnostics information to most error dialogs. This is to help with troubleshooting.
  • Fixed: Scanning will now apply the DPI (resolution) from the scanner to the image, if possible
  • Updated bundled DdsFileTypePlus plugin to v1.10.6.0. See the pdn-ddsfiletype-plus change log on GitHub for more information. Thanks @null54!

paint.net 4.2.14 beta build 7573

Here’s a new beta for 4.2.14 with a bunch of important fixes. I’ve also spent more time in the guts of the system doing some optimization work — you should see better performance, especially on lower end systems, or while working with larger images, or while working with images that have many layers. I’ve eliminated a lot of ephemeral allocations from the rendering engine over the last few months, which has resulted in less pressure for the garbage collector and more CPU time available for actual work (rendering!).

To get this update, make sure you have “Also check for pre-release (beta) versions” enabled in Settings, and then click on the Check Now button. (Unfortunately alpha/beta releases are not currently available for the Microsoft Store version of the app).

image.png

You can also download and install this update directly from the forum.

Changes since 4.2.14 beta build 7547:

  • Fixed the Magic Wand and Paint Bucket tools so that they do calculations in the premultiplied alpha color space. This ensures that transparent colors (alpha=0) with different RGB values are treated as equal, and do not create borders.
  • Fixed the Move Selected Pixels tool so that it fills the uncovered region with 0 (transparent), instead of a transparent version of the secondary color.
  • Improved CPU usage when a selection is active and when GPU accelerated rendering is disabled
  • Improved CPU usage when working on images that have many layers
  • Fixed: Backspace now works correctly in the Colors form: it does not execute Edit -> Fill Selection
  • Improved: Ellipse Selection Tool’s now tessellates at a higher resolution, resulting in smoother circles at small sizes
  • Fixed: Scanning will now apply the DPI (resolution) from the scanner to the image, if possible
  • Updated bundled DdsFileTypePlus plugin to v1.10.6.0. See the pdn-ddsfiletype-plus change log on GitHub for more information. Thanks @null54!
  • Updated bundled AvifFileType plugin to v1.0.9.0. See the pdn-avif change log on GitHub for more information. Thanks @null54!

paint.net 4.2.14 beta build 7547

This build has everything that alpha build 7542 had, as well as some more bug fixes and tweaks.

To get this update, make sure you have “Also check for pre-release (beta) versions” enabled in Settings, and then click on the Check Now button. (Unfortunately alpha/beta releases are not currently available for the Microsoft Store version of the app).

image.png

You can also download and install this update directly from the forum.

Changes since 4.2.14 alpha build 7542:

    • Fixed an issue with copying large images to the clipboard: if an image would take up more than 4GB, it could not be copied because the DIB and DIBV5 formats cannot be larger than that. Now, the DIB and DIBV5 formats are not placed on the clipboard if this happens.
    • Fixed an issue with Effect plugin tooltips which was preventing the menu item from being easily clicked (thanks @toe_head2001 for the fix!)
    • Fixed an issue that was preventing Effect configuration dialogs from working correctly in the Visual Studio designer (thanks @toe_head2001 for the fix!) *
    • Greatly improved performance when saving images at 8-bit color depth *
    • Added diagnostics information to most error dialogs. This is to help with troubleshooting.
    • Updated bundled AVIF FileType plugin to v1.0.5.0. This improves the default speed for saving: “Compression Mode” is renamed to “Compression Speed”, and instead of options for Fast, Normal (old default), Slow, there are now options for Fast (new default), Medium Slow. Thanks @null54!

Changes marked with an asterisk * were actually in the alpha, but I neglected/forgot to include them in the change log.

paint.net 4.2.14 alpha build 7542

This update includes upgraded AV1 (*.avif) support (both opening and saving, and not just on Win10) thanks to the bundling of @null54‘s AvifFileType plugin. Performance and memory usage are improved, particularly when working with large images. Saving large, indexed (8-bit or less) image has been fixed, as well as the palette generation for 4-bit images (which was broken).

To get this update, make sure you have "Also check for pre-release (beta) versions" enabled in Settings, and then click on the Check Now button. (Unfortunately alpha/beta releases are not currently available for the Microsoft Store version of the app).

image.png

You can also download and install this update directly from the forum.

Changes since 4.2.13:

  • New: AV1 (*.avif) images can now be saved (not just opened), due to bundling of @null54‘s AvifFileType plugin (v1.0.4.0). Installation of Microsoft’s codec from the Microsoft Store is no longer necessary, which means this also works on Windows 7 and 8.1.
  • Improved performance in the canvas rendering engine, especially when working with large images, and most notably when scrolling and zooming
  • Reduced memory usage when working with images that have regions of solid color
  • Fixed an issue where saving an image at 4-bit color depth (usually pixel art) was using an incorrect palette (reduced color count/quality). This was due to a bug in Windows Imaging Component (WIC).
  • Fixed an issue where very large images (e.g. 50000 x 50000 px) couldn’t be saved at indexed bit-depths (8-bit or less) due to a bug in Windows Imaging Component (WIC). More information on the forum: https://forums.getpaint.net/topic/116950-error-when-saving-a-big-file/
  • Fixed an issue where BMP images couldn’t be loaded if they had the .PNG extension (there’s an Android screenshot utility out there which does this …)
  • Fixed a rare crash in the Gradient tool ("The tool must be in the Drawing state …")
  • New: Added a list of the DLLs that are loaded into the process on the Settings → Diagnostics page. This is to help troubleshooting scenarios.

paint.net 4.2.13 is now available

This update adds some additional low-bit-depth choices to several file types (PNG, BMP, TIFF), and fixes some bugs.

If you’re using the Windows Store release, you should get the update automatically within the next 24 hours. You can also force an update check by following these instructions.

For the Classic release, you should be offered the update automatically within the next week or so. You can get the update sooner by going to ⚙ Settings → Updates → Check Now. You can also download and install it directly from the website.

Changes since 4.2.12:

  • New: Added 2-bit per pixel support when saving as PNG
  • New: Added 1-bit per pixel support when saving as PNG, BMP, and TIFF
  • Fixed low-bit-depth saving quality (8-bit, etc.), as it would sometimes produce very bad results (e.g. only using 64 colors instead of 256)
  • Fixed: Resizing an image at very large sizes (e.g. 32K pixels to 64K pixels) would fail due to an arithmetic overflow
  • Fixed: Sometimes recently saved images would not have an updated thumbnail in File Explorer unless/until its window was manually refreshed
  • Fixed: Sometimes saving an image to a network share would not work
  • Updated bundled DDSFileTypePlus plugin to version 1.10.4.0, which fixes an issue when loading and saving images using the sRGB color space. This issue was reported here: https://forums.getpaint.net/topic/116572-dds-file-format-bc1-bc7-srgb-export-incorrectly . Thanks @null54!

Enjoy!