Be notified of new releases
Create your free GitHub account today to subscribe to this repository for new releases and build software alongside 40 million developers.Sign up
- Fixed a pointer math error in the Unsharp Mask code that caused occasional overruns of rented ArrayPool buffers.
- Updated to require MagicScaler v0.10.1
Notice: This release contains breaking API changes. See the list below or the detailed change log for more information.
- The behavior of
CropScaleMode.Maxhas been changed so that it no longer upscales the source image if the target size is greater #30. The new
CropScaleMode.Containreplaces the original functionality of
Max. When downscaling, the two modes have identical behavior.
MagicImageProcessor.EnableSimdis now marked obsolete.
- XMP Orientation tags are no longer read by default. Exif Orientation is not affected by this change and is the most common/preferred way of tagging images that require Orientation correction.
IPixelTransformand associated transform implementations have been moved to the
ColorMatrixTransformnow interprets matrices in RGB column-major order instead of BGR column-major order.
ImageFileInfoconstructors have been replaced with a static factory method.
new ImageFileInfo(path/stream/span)is replaced by
ProcessImageSettings.ScaleRatioproperties have been removed.
- Pipeline instrumentation is no longer enabled by default.
MagicImageProcessor.ExecutePipelinehas been replaced with a new
WriteOutputinstance method on
Minor API Changes
ProcessImageSettings, which allows the
Cropto be expressed in dimensions other than the input image dimensions.
- Modified the
Cropsettings behavior to allow for zero or negative dimensions. Zero width or height will be interpreted as all the remaining image. Negative width or height is interpreted as an offset from the right or bottom of the image.
- Lots of new SIMD implementations, using the new .NET Core 3.x x86 hardware intrinsics. Perf gains range from 15-600% in the pixel-mashing code. Real-world gains are limited by other parts of the pipeline and are more pronounced on larger images.
- Reduced GC allocations for both internal pipeline components and interop marshaling. For a typical JPEG resize operation, GC allocations are down by ~75%.
- Replaced WIC YCbCr<->BGR converters with faster and more flexible internal implementations.
- Replaced WIC Fant hybrid scaling with faster internal box scaler.
- Improved efficiency of internal pixel buffers by using all available space in the rented buffer rather than the minimum required/requested.
- Orientation correction is now supported within the planar pipeline. Previously, orientation correction would force processing in RGB mode.
- Orientation correction will now be delayed to post-crop/resize if it is profitable to do so.
- BLAKE2 hashing is now used for color profile matching and for cache file naming. It is both faster and more memory efficient than the MD5 and SHA2 hashing previously used.
Image Quality Improvements
- In planar mode, chroma interpolation now matches that used for luma. Previously,
Hermiteinterpolation was used for scaling chroma planes when the luma plane was scaled with a more expensive filter.
- Images Exif-tagged with
InteropIndex=R03are now interpreted as Adobe RGB, as is done in Photoshop and many other apps. Previously only the non-standard
ColorProfile=Adobe RGBvalue was recognized.
- The new
IImageContainerinterface allows for definition of custom (non-WIC) image containers.
IImageFrameallows for user-defined image frames within an
IYccImageFrameallows for user-defined planar image frames to be processed within the planar pipeline. #31
MagicImageProcessor.BuildPipelinehave new overloads that accept
- The PhotoSauce license has been changed from Apache 2.0 to MIT.
- The libraries are now strong named. #24
- Moved documentation to DocFX https://docs.photosauce.net
- SourceLink is now used for PDB symbol sources, replacing GitLink.
- Added nullable annotations for a better C# 8 dev experience.
The algorithm used for file cache names has changed. You should clear your disk cache when upgrading.
- Updated to use MagicScaler v0.10.0.
- Faster and lighter-weight cache hash calculation.
- The new
CropBasisMagicScaler settings and new
Cropbehavior are available from the query string parameters.
IndexOutOfRangeExceptionwhen reading an ICC profile that has a point-based TRC with no zero value.
- Eliminated a large number of very small GC allocations.
NOTE: This version contains breaking changes to the API. While your code will most likely not require changes, you will have to rebuild when upgrading. Details below...
Span<byte>arguments rather than
IntPtrand size. This will require code changes to anything consuming raw pixel data from a
ProcessingPipelineand to custom
ReadOnlySpan<byte>throughout the public API surface. The built-in implicit conversions should make the change seamless.
- Changed the name of
BlendingMode.Companded. This reflects the fact that pixels may be kept in their original colorspace, which may or may not be sRGB. The old value is still present but is deprecated.
- Changed the namespace of the
System.Drawing.ColorShim. This only affects
netstandard1.xtargets, which are missing
System.Drawing.Colorfrom their versions of the
- Added a
netstandard2.0target, which uses
System.Drawing.Colorrather than the compatibility shim. This change should be seamless but may require removing a
- Fixed "Unupported pixel format" error when processing greyscale images in sRGB/Companded blending mode.
Performance and Image Quality Improvements
- Removed dependency on the Windows Color System for conversion between RGB color spaces based on embedded ICC profiles. The internal MagicScaler implementation is more accurate and significantly faster. Aditionally, conversion to Linear RGB is now defined by the embedded profile, improving quality for images with color spaces that differ significantly from sRGB.
- Improved recognition of sRGB-compatible ICC profiles. These profiles are upgraded on the fly to MagicScaler's internal (more accurate) sRGB definition, meaning fewer unnecessary conversions. Previously only the HP/Microsoft sRGB profile was recognized.
- Added support for greyscale profile conversions. Windows has no default greyscale profile, so these were previously ignored.
- Added hybrid scaling support for CMYK images. Because correct CMYK->RGB conversion is very expensive, this can have significant performance advantages for CMYK TIFF input (hybrid scaling already worked with CMYK/YCCK JPEG).
- Eliminated unnecessary format conversion when the pipeline contains no convolution or color conversion steps.
- Added support for the new Vector conversion JIT Intrinsics in .NET Core 2.1 and .NET Framework 4.7.2, improving SIMD pipeline performance further on these platforms. Note that your project must target these newer runtimes directly in order to take advantage of the improvement.
- Improved performance of the
ColorMatrixTransformfilter. This was previously included as an example of how to implement an
IPixelTransformbut is now used internally.
- Improved convolution quality for partially-transparent pixels when using the non-SIMD pipeline.
- Improved precision for intermediate convolution values in the non-SIMD pipeline, bringing its accuracy extremely close to the floating point (SIMD) version.
Feature Additions and Updates
CropScaleMode.Pad, which preserves the input image aspect ratio and fills undefined pixels in the output rectangle with
- Added support for semi-transparent
MatteColorvalues. Previously, the alpha value was forced to
- Modified the matte processor so that output is converted BGRA->BGR if
MatteColorhas no transparency. Previously in such cases, the alpha channel was preserved even though all pixels were opaque.
OrientationModesetting to allow overriding default orientation correction behavior. #12
ColorProfileModesetting to allow overriding default ICC color profile handling. #13
- Added a
FormatConversionTransformfilter to allow for predictable output pixel format when accessing a pipeline's
- Added a
ProcessImageSettings.Calculate(ProcessImageSettings, ImageFileInfo), which returns the calculated settings that would be used for a given input image. #17
- Added support for modifying transparency with the
ColorMatrixTransformfilter. Previously, the alpha channel passed through the filter untouched.
- Added XML documentation to the NuGet package.
- Updated to use MagicScaler 0.9.0
- Fixed an issue that caused sharpening to be a no-op when working with some pixel formats in sRGB blending mode.
- Improved quality of scaling and sharpening with partially-transparent images in the SIMD pipeline.
- Added GitLink to enable github source server support for debugging.
- Fixed incorrect file extension for 404 images in the disk cache.
- Added exception handler for "Client Disconnected" errors when transmitting images from the HttpHandler.
- Added devicePixelRatio (dpr) setting to enable automatic size and quality adjustments for retina clients.
- Added "q" shortcut for quality setting.
- Fixed image corruption (and possible access violation) when sharpening BGR/BGRA images in sRGB blending mode.
- Use latest System.Buffers version for .NET Framework installations
- Require MagicScaler 0.8.3 or later
- Fix nuget config transform to place configSections as the first child of configuration
No longer throws an exception if an image contains an invalid embedded ICC profile. Color management is silently skipped in these cases.
NOTE: This version contains breaking changes to the API. While your code will most likely not require changes, you will have to rebuild when upgrading.
- Changed parameter names on public methods to be more descriptive.
- Changed ProcessImage() overloads that accepted byte to accept ArraySegment<byte>.
- Added metadata support (including Exif auto-rotation) to the .NET Core version.
- Added ImageFileInfo class to expose basic information read from image headers.
- Added IPixelSource interface to allow clients to feed pixels into the pipeline from custom sources.
- Added IPixelTransform interface to allow custom filtering.
- Added ProcessingPipeline class to allow clients to request pixels from the pipeline without saving directly to an image file.
- Added ProcessImageResults class to expose calculated settings used and basic instrumentation.
- Added sample IPixelSource and IPixelTransform implementations.
- Improved fixed-point math accuracy for non-SIMD implementation.
- Improved RGBA performance in SIMD implementation.
- Improved Auto output format logic to match WebRSize.
- Fixed invalid crop values when using Hybrid scaling.
- Fixed invalid crop offsets when using Planar mode.
- UnsharpMaskSettings no longer overrides the Sharpen setting. If Sharpen is false, there will be no auto-sharpening regardless of UnsharpMaskSettings.
NOTE: Cache file naming has changed in this version. You should empty your WebRSize disk cache when upgrading.
- Changed cache file name generator to use the correct file extension when transcoding to a different format.
- Fixed a bug in the cache file name generator that caused duplicate cache files.
- Improved speed and reduced allocations in the HTTP intercept module.