paint.net 4.2.16 beta build 7772

Hot on the heels of 4.2.16 beta build 7765, this build fixes a new issue when saving images at 8-bit color depth if they have transparency (as reported here and in a few other posts: https://forums.getpaint.net/topic/118074-autodetect-bit-depth-on-saving-png-files-fails-on-beta-4216776543041/)

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 it directly on the forum.

Change log:

  • Fixed an error when trying to save images that have transparency at 8-bit color depth

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 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.13 alpha build 7497

This update adds some additional low-bit-depth choices to several file types (PNG, BMP, TIFF), and fixes some bugs. I should be able to do a final release of this soon!

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 post on the forum.

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: 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 on a non-Windows server (e.g. Linux) 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!

paint.net 4.2.11 alpha build 7420

This is just a hotfix for 4.2.11 alpha build 7417 that fixes a crash in the built-in updater’s “Check Now” button.

NOTE: This post was originally for build 7419. It has been updated to build 7420 to fix an issue at app shutdown that prevented the process from terminating correctly. Sorry for the confusion.

To get this update if you have installed 7417, just launch or use the app as usual. You’ll be notified of the update within about 24 hours (it only checks at app startup though). Normally I’d say you should follow the instructions below, but the Check Now button is currently broken.

(If you really want to force the check to happen now, first exit the app. Then, delete the registry key at HKCU\SOFTWARE\paint.net\ named “Updates/LastCheckTimeUtc”. Then, start the app again.)

To get this update if you have NOT installed 7417, 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

Paint.NET v4.2.6 will require SSE2 on 32-bit / x86

I’m just giving everyone a heads-up that the minimum system requirements will be increasing a little with the upcoming version 4.2.6 update. The change is simply to require a processor with SSE2 instead of SSE for the 32-bit version of the app. The 64-bit version is unchanged; it has always required SSE2 because the 64-bit “x64” instruction set has always included SSE2 (as per AMD, Intel, and Microsoft).

Most systems aren’t affected by this. All modern CPUs have had support for SSE2 since 2003 or so.

Here’s a list of the newest processors that will no longer be supported:

So on the Intel side you just need a Pentium 4 or newer (circa 2000). On the AMD side you’ll need an Athlon 64 or newer (circa 2003). So if you bought your computer within the last, oh, 15 years … you’ll be fine! Otherwise you should probably upgrade anyway, or just stick with older versions of Paint.NET and turn off the built-in updater.

I’ve never really felt a strong compulsion to bump up the minimum CPU requirements. I always maintain “scalar” code paths for anything optimized to use SIMD instructions (SSE2, AVX2, etc.) so that I never get locked in to any particular instruction set or CPU architecture. This permits me to port to other CPU architectures, e.g. ARM, if/when that actually becomes compelling or even necessary.

However, .NET Core requires SSE and SSE2 on x86, so this change will help get things ready for that migration. I don’t have a concrete timeline for this, and my estimates for things like this have historically been bad, but hopefully within the next year or so.

This also means the 32-bit version of the app will get a small performance boost in the 4.2.6 update. The Visual C++ compiler optimizes a few key code paths in the C++ code which are used for things like BGRA32 –> PBGRA32 pixel format conversion, as well conversions between integers, floats, and doubles. (However, with the migration to .NET Core, these may actually be better implemented in C# code!)

paint.net 4.2.2 beta build 7198

This beta build has a few new fixes, and some more performance optimizations for application startup (especially if you have lots of custom shapes installed!).

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.

image.png

You can also download this by heading over to the forum where I’ve put a direct download link.

Changes since 4.2.2 beta build 7192:

  • Improved: Changed maximum image size from 65,535 x 65,535 pixels to 262,144 x 262,144 pixels. This is mostly for accommodating very tall or very wide images.
  • Improved app startup time when many custom shapes are installed, and/or when opening many images
  • Fixed a crash when manually typing in a very large number for the zoom level in the status bar

paint.net 4.2.2 beta build 7192

This is a new beta for the 4.2.2 release. The final release should be coming soon!

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.

image.png

You can also download this by heading over to the forum where I’ve put a direct download link.

Changes since 4.2.2 beta build 7186:

  • New: 4-bit saving is now supported for PNG, BMP, and TIFF
  • New: The palette selection menu will now indicate which palette is currently active (thanks @null54 for the implementation!)
  • Improved: Startup performance has been further optimized, especially for quad-core (or more) CPUs
  • Updated: @null54‘s bundled DDSFileTypePlus plugin has been updated to version 1.9.6.0

paint.net 4.2.1 beta build 7152

This upcoming release is adding JPEG XR support and fixing a handful of important bugs.

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.

image.png

You can also download it directly by heading over to the forum.

Changes:

  • New: JPEG XR file type support
  • Fixed: Holding Ctrl when dragging a selection with Move Selected Pixels will again leave a copy behind (but only with the mouse)
  • Fixed: The mouse wheel may now be used to scroll the Palettes menu in the Colors window (thanks @AndrewDavid for the suggestion and @toe_head2001 for the fix!)
  • Fixed crashes when saving DDS images
  • Fixed VTF plugin compatibility; it was not working in 4.2 except for images that were an exact power-of-2 size on each dimension
  • Fixed: .BMP files can be opened even if they’re not actually BMP images (they still need to be a valid WIC-supported file type such as PNG, JPEG, etc.)
  • Fixed (stabilized) menu ordering of effect plugins that have duplicate names
  • Fixed metadata handling that was preventing some images with EXIF tag 330 from being able to load
  • Fixed metadata preservation for old images that pad EXIF string values with null terminators
  • Fixed title bar text color when using certain custom accent colors in Windows 10
  • Fixed very bad performance when opening large images with embedded rotation metadata