Skip to content

MagicScaler 0.10.0.0

Compare
Choose a tag to compare
@saucecontrol saucecontrol released this 06 Jan 08:00
· 210 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 https://docs.photosauce.net
  • 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.

Changes

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