Skip to content

@saucecontrol saucecontrol released this Jan 8, 2020

MagicScaler v0.10.1

  • Fixed a pointer math error in the Unsharp Mask code that caused occasional overruns of rented ArrayPool buffers.

WebRSize v0.4.1

  • Updated to require MagicScaler v0.10.1
Assets 2

@saucecontrol saucecontrol released this Jan 6, 2020 · 7 commits to master since this release

MagicScaler v0.10.0

Notice: This release contains breaking API changes. See the list below or the detailed change log for more information.

Breaking Changes

  • The behavior of CropScaleMode.Max has been changed so that it no longer upscales the source image if the target size is greater #30. The new CropScaleMode.Contain replaces the original functionality of Max. When downscaling, the two modes have identical behavior.
  • MagicImageProcessor.EnableSimd is 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.
  • IPixelTransform and associated transform implementations have been moved to the PhotoSauce.MagicScaler.Transforms namespace.
  • ColorMatrixTransform now interprets matrices in RGB column-major order instead of BGR column-major order.
  • ImageFileInfo constructors have been replaced with a static factory method. new ImageFileInfo(path/stream/span) is replaced by ImageFileInfo.Load(path/stream/span).
  • ProcessImageSettings.IndexedColor and ProcessImageSettings.ScaleRatio properties have been removed.
  • Pipeline instrumentation is no longer enabled by default.
  • MagicImageProcessor.ExecutePipeline has been replaced with a new WriteOutput instance method on ProcessingPipeline.
  • Dropped netcoreapp1.x and netstandard1.x support.

Minor API Changes

  • Added CropBasis property to ProcessImageSettings, which allows the Crop to be expressed in dimensions other than the input image dimensions.
  • Modified the Crop settings 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.
  • ImageFileInfo.Frames now returns IReadOnlyList<FrameInfo> instead of FrameInfo[].
  • ProcessImageSettings.HybridScaleRatio now returns int rather than double.
  • PixelSourceStats.PixelCount now returns long rather than int.

Performance Improvements

  • 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, Hermite interpolation was used for scaling chroma planes when the luma plane was scaled with a more expensive filter.
  • Images Exif-tagged with ColorProfile=Uncalibrated/InteropIndex=R03 are now interpreted as Adobe RGB, as is done in Photoshop and many other apps. Previously only the non-standard ColorProfile=Adobe RGB value was recognized.

New APIs

  • The new IImageContainer interface allows for definition of custom (non-WIC) image containers.
  • IImageFrame allows for user-defined image frames within an IImageContainer.
  • IYccImageFrame allows for user-defined planar image frames to be processed within the planar pipeline. #31
  • MagicImageProcessor.ProcessImage and MagicImageProcessor.BuildPipeline have new overloads that accept IImageContainer.

Non-behavioral Changes

  • The PhotoSauce license has been changed from Apache 2.0 to MIT.
  • The libraries are now strong named. #24
  • Moved documentation to DocFX
  • SourceLink is now used for PDB symbol sources, replacing GitLink.
  • Added nullable annotations for a better C# 8 dev experience.

WebRSize 0.4.0

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 CropBasis MagicScaler settings and new Crop behavior are available from the query string parameters.
Assets 2

@saucecontrol saucecontrol released this Sep 4, 2018 · 59 commits to master since this release

  • Fixed IndexOutOfRangeException when reading an ICC profile that has a point-based TRC with no zero value.
  • Eliminated a large number of very small GC allocations.
  • Added PadTransform filter. #21
Assets 2

@saucecontrol saucecontrol released this Aug 16, 2018 · 65 commits to master since this release

MagicScaler 0.9.0

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...

Breaking Changes

  • Changed IPixelSource to accept Span<byte> arguments rather than IntPtr and size. This will require code changes to anything consuming raw pixel data from a ProcessingPipeline and to custom IPixelSource and IPixelTransform implementations.
  • Changed ArraySegment<byte> arguments to ReadOnlySpan<byte> throughout the public API surface. The built-in implicit conversions should make the change seamless.
  • Changed the name of BlendingMode.sRGB to 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-compatible Color class from System.Drawing.Temp to System.Drawing.ColorShim. This only affects netcoreapp1.x and netstandard1.x targets, which are missing System.Drawing.Color from their versions of the System.Drawing.Primitives NuGet package.
  • Added a netstandard2.0 target, which uses System.Drawing.Color rather than the compatibility shim. This change should be seamless but may require removing a using statement.


  • 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 ColorMatrixTransform filter. This was previously included as an example of how to implement an IPixelTransform but 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

  • Added CropScaleMode.Pad, which preserves the input image aspect ratio and fills undefined pixels in the output rectangle with MatteColor.
  • Added support for semi-transparent MatteColor values. Previously, the alpha value was forced to byte.MaxValue.
  • Modified the matte processor so that output is converted BGRA->BGR if MatteColor has no transparency. Previously in such cases, the alpha channel was preserved even though all pixels were opaque.
  • Added OrientationMode setting to allow overriding default orientation correction behavior. #12
  • Added ColorProfileMode setting to allow overriding default ICC color profile handling. #13
  • Added a FormatConversionTransform filter to allow for predictable output pixel format when accessing a pipeline's IPixelSource. #20
  • Added a GaussianBlurTransform filter. #10
  • Added 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 ColorMatrixTransform filter. Previously, the alpha channel passed through the filter untouched.
  • Added XML documentation to the NuGet package.

WebRSize 0.3.3

  • Updated to use MagicScaler 0.9.0
Assets 2

@saucecontrol saucecontrol released this Jan 17, 2018 · 91 commits to master since this release


  • 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.
Assets 2

@saucecontrol saucecontrol released this Dec 23, 2017 · 97 commits to master since this release


  • 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
Assets 2

@saucecontrol saucecontrol released this Dec 14, 2017 · 98 commits to master since this release

No longer throws an exception if an image contains an invalid embedded ICC profile. Color management is silently skipped in these cases.

Assets 2

@saucecontrol saucecontrol released this Dec 12, 2017 · 100 commits to master since this release

Fixed "Unsupported Pixel Format" error when converting 16-bit CMYK to RGB formats using an ICC profile

Assets 2

@saucecontrol saucecontrol released this Sep 5, 2017 · 101 commits to master since this release


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.
Assets 2

@saucecontrol saucecontrol released this May 7, 2017 · 139 commits to master since this release

  • Allow 0 Width and Height in Crop Mode from WebRSize. This re-enables crop-only or transcode-only operations.
Assets 2
You can’t perform that action at this time.