Releases: saucecontrol/PhotoSauce
MagicScaler 0.15.0
MagicScaler v0.15.0
Breaking Changes
- All previous codec plugin packages are incompatible with the new release. New versions of all codec plugins are available as detailed below. Make sure you have the "include prerelease" checkbox checked if using the NuGet Package Manager UI to update.
- Linux builds of the native codec plugins are now built on Ubuntu 22.04 LTS and require glibc 2.35 or greater.
- Dropped support for .NET Framework 4.6.1, .NET 6, and .NET 7, which are now out of support by Microsoft.
Fixes
- Fixed "Unsupported pixel format" exception when using the WebP native codec plugin and converting an image with transparency by adding an opaque
MatteColor. #165 - Fixed "The buffer allocated is insufficient" exception when using the WIC WebP codec. #167
- Fixed "The component initialization has failed" exception when running on Windows Server Core. Some conversions will still be unavailable, but the error message is improved. #168
- Fixed improper result when cropping a CMYK JPEG image using the WIC JPEG codec on newer Windows 11 builds. See: https://github.com/saucecontrol/wic-jpeg-bug
API Changes
Updated the experimental TransformFactory.CreateConversionTransform API to allow for re-use of parsed color profiles between calls. #163
Performance Improvements
- Enabled AVX2 gather-based implementations of format conversions on newer Intel processors not affected by the Gather Data Sampling ('Downfall') vulnerability or mitigations.
- Updated to a new version of Blake2Fast for faster color profile matching.
Native Codec Previews
- WebP
- Updated
libwebpto latest version.
- Updated
- HEIF
- Updated
libheifand its AV1 frame decoder (dav1d) to the latest versions.
- Updated
- JPEG
- Updated
libjpeg-turboto latest version.
- Updated
- PNG
- Updated
libpngandzlib-ngto latest version.
- Updated
- JPEG XL
- Updated
libjxlto latest version. - Note that all previous versions have reported CVEs
- Updated
- GIF
- New package only. No change to native binary.
WebRSize v0.6.11
- Updated to use MagicScaler v0.15.0
MagicScaler 0.14.2
This release resolves a packaging issue from v0.14.1. It contains no code changes. #152
MagicScaler 0.14.1
MagicScaler v0.14.1
Important: All previous codec plugin packages are incompatible with this new release. New versions of all codec plugins are available, as detailed below. Make sure you have the "include prerelease" checkbox checked if using the NuGet Package Manager UI to update.
Fixes
- Fixed a bug in the validation of frame ranges when using a decoder supporting
IMultiFrameDecoderOptions#151 - Fixed an issue that prevented WIC codecs from decoding an image when the image did not start at the beginning of an input
Stream. - Fixed possible incorrect DPI when mixing a WIC encoder with native plugin decoders using resolution units other than inches.
Behavioral Changes
- Pipelines created with
MagicImageProcessor.BuildPipelineno longer force conversion to sRGB by default. You can use theColorPofileMode.ConvertToSrgbsetting to force the old behavior if necessary. - Little-CMS is no longer used opportunistically by default on Windows. Some users were confused by DLL load failures showing up in the debugger since
lcms2.dlldoes not ship in the package. #128 - Referencing MagicScaler from a project using a .NET
TargetFrameworkversion that is no longer supported will now generate a warning. Because MagicScaler ships with anetstandard2.1binary, it will still work on these platforms, but it will use non-hardware-accelerated fallback code. The warning makes it clear when this is happening and can be disabled if necessary.
Native Codec Previews
- Improved handling of exceptions on managed <-> native transitions on Linux. Previously, an exception thrown in a managed callback from a native codec would result in a generic failure message. Now, the managed exception context is preserved, and the proper exception is thrown on return from the native code.
- Improved handling of truncated or corrupted images in all native decoders (particularly GIF and PNG). The decoders will now decode as much of the image as they are able and will return empty pixels for the remainder. #108 #140
- WebP
- Fixed an issue that resulted in misaligned subframes in some lossy animated WebP output.
- Fixed an issue that resulted in some pixels not clearing to fully transparent in some lossy animated WebP output.
- HEIF
- Updated
libheifand its frame decoders (libde265anddav1d) to the latest versions. - Included some additional
ftypsignatures that may be found in valid HEIC/AVIF files. - Mitigated a possible access violation on images that decode to a different size than initially reported on header read, due to inconsistent handling of transform boxes in
libheifstrukturag/libheif#1131. These cases will now return a decode error.
- Updated
- JPEG
- Updated
libjpeg-turboto latest version. - Reduced managed allocations in the decoder.
- Updated
- PNG
- Updated
libpngto latest version. - Relaxed some validation in the decoder. #139
- Updated
- GIF
- Updated
GIFLIBto latest version.
- Updated
- JPEG XL
Performance Improvements
- Fixed a performance regression introduced by Intel's Gather Data Sampling ('Downfall') vulnerability mitigations, by disabling Gather for simple LUT mappings. With the microcode patch active, Gather performance is very significantly reduced (on the order of 4-5x slower). If you are running in an environment where mitigations are disabled, setting the
PhotoSauce.MagicScaler.GdsMitigationsDisabledAppContext switch, will restore the Gather-based implementations.
API Additions
PlanarEncoderInfois now public, for use in configuring defaults for JPEG and WebP encoders. #133- Added new
IIccColorProfileSourceandIExifSourcemetadata interfaces to allow codec authors to make this metadata available to the MagicScaler pipeline. - Added a new
TransformFactoryclass in thePhotoSauce.MagicScaler.Experimentalnamespace, which allows for advanced use of some of MagicScaler's internal transform implementations. This API was added specifically to support Paint.NET, and as the namespace implies, it is experimental and subject to change on a whim. If anyone else finds the experimental features useful, please speak up in a discussion, or risk losing them.
WebRSize v0.6.9
- Updated to use MagicScaler v0.14.1
MagicScaler 0.14.0
MagicScaler v0.14
Notice: This release contains breaking API changes.
Breaking Changes
- Dropped support for
netcoreapp3.1, which is now out of support by Microsoft. - Removed several APIs that were obsoleted in v0.13. See #62 for details.
- All previous codec plugin packages are incompatible with the new release. New versions of all codec plugins are available as detailed below. Make sure you have the "include prerelease" checkbox checked if using the NuGet Package Manager UI to update. #125
Fixes
- Fixed a possible buffer overrun when using WIC's color transform for LUT-based ICC profile conversion. #119
- Fixed an issue in decoding GIF images with certain unusual combinations of frame disposal. #114
- Fixed an issue that caused GIF images with no looping metadata to be set to infinite loop on save. #124
- Fixed a possible decode issue on GIF images with an out of bounds transparency index.
- Improved native codec DLL resolution in .NET Framework targets. #107
Native Codec Previews
- Updated
libwebpcodec package to latest version. #123
⚠ The previous version contains a critical security vulnerability ⚠ - Updated
libjpegcodec package to latest version oflibjpeg-turbo. - Updated
libpngcodec package to latest version. - Updated
libheifcodec package to latest version. - Updated
libjxlcodec package to latest version.
Linux Improvements
- Conversion of CMYK JPEG files is now supported when Little-CMS (liblcms2) v2.09 or later is available. #103
Performance Improvements
- Improved SIMD implementation of orientation transforms.
- Improved speed of some pixel format conversions.
Image Quality Improvements
This release contains several color management improvements, as detailed in #105
- A true Display P3 profile is now embedded in output images when the source is in a wide-gamut format.
- A new compact CMYK profile is now used for images without an embedded profile on both Windows and Linux, giving more consistent color conversion results.
- Implemented gamma slope limiting, as recommended in the Adobe RGB specification.
WebRSize v0.6.8
- Updated to use MagicScaler v0.14
MagicScaler 0.13.2.0
MagicScaler v0.13.2
This version marks the first release with near-complete functionality on Linux. Linux use requires registration of one or more native codecs.
Fixes
- Fixed a bug that caused
ProcessImageSettingsinstances to be mutated, which may have resulted in issues when using a single settings object for multiple processing operations. - Fixed a math error in conversions between DPI and DPC in resolution metadata.
- Fixed dependency versioning for native codec packages when targeting downlevel frameworks #96
Cross-Platform Codec Previews
- Added
libjpeg-turboplugin with significantly improved performance over WIC's JPEG codec and support for progressive JPEG encoding. - Added
libpngplugin with support for APNG (decode enabled by default). - Added
GIFLIBplugin. - Updated
libwebpto latest version and improved animation support. - Updated
libheifto latest version (resolves a significant performance issue strukturag/libheif#551) and added AVIF decoding support #97. - Updated
libjxlto latest version.
Performance Improvements
- Improved speed of RGB<->BGR and RGBA<->BGRA conversions.
WebRSize v0.6.7
- Updated to use MagicScaler v0.13.2
MagicScaler 0.13.1.0
MagicScaler v0.13.1
Fixes
- HEIC orientation is now handled correctly when using the Windows HEIF decoder. Previously, the Exif orientation value was used, which may have resulted in double correction if the Exif value did not match the value in the HEIF header.
- Fixed a possible
PlatformNotSupportedExceptionwhen running on hardware that supports AVX but not AVX2 (only very old Intel Ivy Bridge and Sandy Bridge processors had this configuration). - Added
SupportedOSPlatformattribute to theUseWicCodecs()extension method to ensure it is only available on Windows targets. - Added a new .NET 7 target and included a fix to work around an issue when publishing with Native AOT using .NET 7 preview SDKs. (see dotnet/runtime#73659)
API Changes
ProcessImageSettings.TrySetEncoderFormatnow accepts either MIME type or file extension. Input strings starting with a.will be interpreted as file extensions, all others will be interpreted as MIME type.- Added
ImageFileExtensionsclass containing constants for common image file extensions to support the above. - Added new members to the
ChromaPositionenum to support additional subsampled chroma locations. The previous 'interstitial' and 'cosited' values have been editor hidden, and the new explicit locations should be used.
Native Codec Previews
- Added a missing file signature to the
libheifplugin. #89 - Added a
libwebpwrapper with support for lossy, lossless, and animated WebP decoding and encoding. #19 - All native codec plugins have been updated to remove any previously-registered codecs with the same MIME type by default. For example, on Windows versions that include a WebP decoder,
UseWebp()will replace the Windows WebP decoder in the pipeline in addition to registering the new encoder. If you want explicit control over registration and ordering,UseWebp(removeExisting: false)would match the old behavior.
Behavioral Changes
- The planar pipeline is now used in more cases when decoding JPEG sources. Previously, planar processing was disabled when reading chroma-subsampled images with non-standard orientation or when specifying an explicit crop area with odd bounds. These cases are now handled correctly by the planar pipeline, so they are enabled by default.
- When using automatic cropping, the crop is now correctly centered when working with chroma subsampled planar sources. Previously, the crop was snapped to the nearest multiple of the subsampling ratio.
- The animated GIF encoder no longer includes the complete global palette from the source image. It now adds only the canvas background color.
- In-codec crop and scale are now supported for non-WIC codecs. WebP is the first plugin codec to use this support.
Performance Improvements
- Conversions to formats that are the same bit-depth or larger now always use the output buffer for intermediate processing instead of a separate intermediate buffer.
- Conversion to and from planar video formats is now fully SIMD accelerated.
- SIMD implementations have been improved for some common operations:
- Codec matching by file signature.
- Conversions from pBGRA128 to BGRA32.
- Transposing orientation corrections.
Image Quality Improvements
- Improved accuracy in the processing of chroma planes in the SIMD planar pipeline.
WebRSize v0.6.6
- Updated all number parsing to use explicit Invariant culture.
- Updated to use MagicScaler v0.13.1
MagicScaler 0.13.0.0
MagicScaler v0.13
Notice: This release contains breaking API changes. See the list below or the detailed change log #62 for more information.
Breaking Changes
- Codec discovery is now internal to MagicScaler. The pipeline will find WIC codecs automatically, but the codec set and priority order may be different than seen in previous MagicScaler versions. See the change log for details and customization options.
- The
FileFormatenum has been deprecated in favor of MIME types in all APIs where it was previously used. - A few
ProcessImageSettingsproperties have been deprecated in favor of codec-specific option types. - All
MagicImageProcessorstatic properties that controlled global settings have been moved to eitherAppContextvalues or codec options - The
IImageContainerandIImageFrameinterfaces have changed, with some of the properties moving to the new codec integration interfaces. - Dropped support for
netcoreapp2.1, which is now out of support by Microsoft, andnet5.0which goes out of support next month.
New APIs
CodecManagerallows explicit configuration of encoders and decoders, along with their default codec-specific configurations.- Many new codec-specific option types have been added, based on the
IDecoderOptionsandIEncoderOptionsinterfaces. - Multiple new interfaces have been added to allow codec authors to define image decoders, encoders, metadata sources, and metadata items. #22
- Added a new zone plate test pattern generator --
ZonePlatePixelSource.
Native Codec Previews
- Added a
libheifwrapper capable of decoding Apple HEIC images. - Added a
libjxlwrapper to preview JPEG XL support. The underlying native library is quite unstable in this release, so use with extreme care.
Performance Improvements
- Added new internal buffered
Streamimplementation to improve on the the buffering inFileStream. - Improved speed of palette selection and mapping for indexed color formats.
- Improved speed of conversion from YCbCr to BGR formats.
- Improved hybrid scaling quality and speed on BGRA images.
- Changed buffer pool settings to match the new .NET 6 defaults.
Image Quality Improvements
- Improved palette selection when converting high-color images to indexed formats. The new algorithm performs better on gradients by weighting color population more heavily, while the old algorithm preferred greater distance between colors, with the expectation that dithering would benefit from wider color choice.
Non-behavioral Changes
- IL Trimming for self-contained apps is now enabled for all libraries.
WebRSize v0.6.5
- Updated to use MagicScaler v0.13
Some default settings have changed and may result in duplicate cache images for source/size combinations. It is recommended you clear your cache when deploying the new release.
MagicScaler 0.12.2.0
MagicScaler v0.12.0
Fixes
- Fixed possible corrupted output when using a custom
IYccImageFramewith hybrid scaling #78
WebRSize v0.6.4
- Updated to use MagicScaler v0.12.2
MagicScaler 0.12.1.0
Breaking Changes
- Removed the previously obsoleted
BuildPipelineoverload that acceptsReadOnlySpan<byte>. This was meant to have been removed in the v0.12.0 release.
Fixes
- Fixed a possible
NullReferenceExceptionwhen a PixelSource referenced only by a WIC component was garbage collected while still in use #69.
Behavioral Changes
- When saving an AdobeRGB image to PNG format, a compatible V4 ICC profile will be embedded. This was the only remaining normalized color space that lacked a V4 profile.
IYccImageFramesources in video YUV format are now converted correctly to full-range before output regardless of whether they pass through any other filters.
MagicScaler 0.12.0.0
MagicScaler v0.12.0
Breaking Changes
- Removed
netcoreapp3.0target and replaced it with anetcoreapp3.1target.
Fixes
- Fixed a
NotSupportedExceptionwhen processing malformed animated GIFs which contain some frames larger than the Logical Screen Descriptor specifies. These frames will now be cropped to the logical screen size. - Fixed an
ArrayPoolarray leak in the animated GIF encoder. (ArrayPoolarrays cannot actually be leaked in the traditional memory leak sense, but they become eligible for garbage collection if not returned to the pool, negating the benefit of using the pool for those arrays.)
Performance Improvements
- Replaced all WIC interop code with a new lightweight implementation based on TerraFX.Interop.Windows, powered by ClangSharp and the new C# 9 function pointer support. This results in a 5-10% performance gain in many cases, with larger image sources yielding larger gains due to the chatty nature of WIC interop over managed
Streamimplementations. - Added a new large buffer pool, using a custom
ArrayPoolinstance. The new pool allows re-use of buffers between 1MiB and 16MiBs.
There are few cases where MagicScaler uses buffers this large, but applications processing animated GIFs or performing orientation correction on large images may benefit. If no large buffers are required, the pool will remain empty. The pool can be disabled by setting theMagicImageProcessor.EnableLargeBufferPoolproperty if necessary. - Added SIMD-accelerated implementations of transposing and horizontal flip orientation transforms.
- Modified the SIMD convolution processors to perform better on AMD processors.
Quality Improvements
- Improved the accuracy of palette matching when converting to an indexed color format, with a slight speed increase in most cases.
Behavioral Changes
- When saving a PNG image that requires a wide-gamut color profile, a v4 compact profile is now embedded instead of the normal v2 profile. WIC sets the
gAMAandcHRMtags along withiCCPwhen saving a v2 ICC profile, and Chromium-based web browsers ignore the color profile whengAMAand/orcHRMis set, resulting in incorrect display. Setting a v4 ICC profile works as expected. - When transcoding a wide-gamut image to GIF or BMP formats, which don't support embedding ICC profiles, the color space is now converted to sRGB by default. Previously, this was done only if
ProcessImageSettings.Calculatewas called beforeProcessImage. - Added instrumentation to the indexed color converter when
EnablePixelSourceStatsis enabled. - The planar pipeline is no longer used when performing a transcode-only (no resizing) operation on a JPEG.
WebRSize v0.6.3
- Updated to use MagicScaler v0.12.0