MagicScaler 0.10.0.0
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 newCropScaleMode.Contain
replaces the original functionality ofMax
. 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 thePhotoSauce.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 byImageFileInfo.Load(path/stream/span)
.ProcessImageSettings.IndexedColor
andProcessImageSettings.ScaleRatio
properties have been removed.- Pipeline instrumentation is no longer enabled by default.
MagicImageProcessor.ExecutePipeline
has been replaced with a newWriteOutput
instance method onProcessingPipeline
.- Dropped
netcoreapp1.x
andnetstandard1.x
support.
Minor API Changes
- Added
CropBasis
property toProcessImageSettings
, which allows theCrop
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 returnsIReadOnlyList<FrameInfo>
instead ofFrameInfo[]
.ProcessImageSettings.HybridScaleRatio
now returnsint
rather thandouble
.PixelSourceStats.PixelCount
now returnslong
rather thanint
.
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-standardColorProfile=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 anIImageContainer
.IYccImageFrame
allows for user-defined planar image frames to be processed within the planar pipeline. #31MagicImageProcessor.ProcessImage
andMagicImageProcessor.BuildPipeline
have new overloads that acceptIImageContainer
.
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 newCrop
behavior are available from the query string parameters.