Skip to content

MagicScaler 0.9.0.0

Compare
Choose a tag to compare
@saucecontrol saucecontrol released this 16 Aug 02:15
· 267 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.

Fixes

  • 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