Releases: saucecontrol/PhotoSauce
Releases · saucecontrol/PhotoSauce
MagicScaler 0.11.2.0
MagicScaler v0.11.2
Fixes
- Fixed an issue that might cause extra characters to be included in WebRSize base32-encoded cache hashes. #57
Behavioral Changes
- Image pixel format is now converted when using
CropScaleMode.Pad
and theMatteColor
is not compatible with the source image format. #59 - Output GIF palettes may now be smaller when the source image has few colors. Previously all palettes were 256-color even if some weren't used.
Performance Improvements
- Now using the new
SkipLocalsInit
functionality from C# 9. - Added more SIMD-optimized pixel format conversions.
WebRSize v0.6.2
Updated to use MagicScaler v0.11.2
MagicScaler 0.11.1.0
MagicScaler v0.11.1
Fixes
- Removed unnecessary NuGet dependency on
Microsoft.NETFramework.ReferenceAssemblies
for .NET Framework builds. - Fixed
CropScaleMode.Contain
andCropScaleMode.Max
behavior when only a single dimension is constrained and the constrained dimension is the smaller dimension in the source image. - Fixed an issue that caused the Display P3 color profile to be omitted from some images.
Performance Improvements
- Faster AVX2 implementation of BLAKE2b hashing.
WebRSize v0.6.1
Updated to use MagicScaler v0.11.1
MagicScaler v.0.11.0.0
Animated GIF support is finally here!
Huge thanks to Carbonmade for sponsoring the work on the new GIF features
MagicScaler v0.11.0
Breaking Changes
- Changed minimum .NET Framework version to 4.6.1 (from 4.6). This is the lowest version that technically supports .NET Standard 2.0, and Microsoft has stopped updating some of their OOB packages for older versions. Microsoft NuGet dependencies were also updated to the latest versions supported by 4.6.1. This should reduce the number of version conflicts such as #48 and #36
- Running MagicScaler on an STA thread, such as the UI thread in a WinForms or WPF app, is no longer supported and will throw an exception. This was always discouraged for performance reasons, but the new animated GIF support requires the WIC GIF codec's MTA behavior, so it is now forbidden. The best solution is to use
Task.Run
to invoke MagicScaler on a background thread. - Removed the previously obsoleted
GammaMode.sRGB
. The removed value is replaced byGammaMode.Companded
. - Obsoleted the
BuildPipeline
overload that acceptsReadOnlySpan<byte>
. This was previously mentioned in #38
Behavioral Changes
- An animated GIF source will now result in an animated GIF output if the
SaveFormat
setting isFileFormat.Auto
orFileFormat.Gif
andFrameIndex
is set to0
. In previous versions, only a single frame of an animated GIF could be selected for output. #40 - Source images with a wide-gamut color profile will now result in a wide-gamut output under the default
ColorProfileMode.Normalize
setting. The old behavior of normalizing all images to sRGB can be re-enabled withColorProfileMode.ConvertToSrgb
if you are dealing with non-color-aware downstream software. More details are given in #51 - Color profile validation has been slightly relaxed. The wacky ICC profile that caused the Android crashes that made news recently was ignored by previous MagicScaler versions but will now correctly convert to a safe wide-gamut profile under the default
ColorProfileMode
. CropScaleMode.Max
andCropScaleMode.Contain
now work with0
width or height. Previously both width and height had to be set for all modes other thanCropScaleMode.Crop
. #52 #43
Performance Improvements
- Improved speed across the library and further reduced GC allocations for common resizing tasks.
Quality Improvements
- Replaced WIC palette generation and dithering for indexed color formats with a much higher quality internal implementation. The improvements apply to both GIF and PNG8 output.
WebRSize v0.6.0
Changes
- Updated to use MagicScaler v0.11.0
- The minimum supported .NET Framework version is now 4.6.1
- Fixed a bug that caused the 404 (not found) handler to error instead of returning a placeholder image
MagicScaler v0.10.3.0
MagicScaler v0.10.3
Fixes
- Fixed possible access violations when using
ProcessImage
andBuildPipeline
overloads that acceptReadOnlySpan<byte>
image buffer inputs #38. - When extracting a frame from an animated GIF, the GIF is now played forward to the requested frame, honoring the disposal method of each previous frame to ensure the correct state is decoded.
ImageFileInfo
now reports correct dimensions for GIF frames, based on the Logical Screen Descriptor. Previously, only the encoded frame dimensions were reported.
Performance Improvements
- Improved speed of Y'CbCr->BGR conversions.
Changes
- Made
ImageFileInfo
constructor public to enable additional WebRSize scenarios.
Non-Behavioral Changes
- Downgraded versions of Microsoft NuGet package dependencies on .NET Framework targets to close the dependency loop and prevent
TypeInitializationException
in the absence of a config with correctbindingRedirect
s #36.
If you update to the most recent versions of all dependency packages and your NuGet client doesn't update your config properly, the requiredbindingRedirect
versions (current as of now) can be found at: #36 (comment)
WebRSize v0.5.1
Changes
- Updated to use MagicScaler v0.10.3
- Wired up the existing but non-functional
enabled
property on thediskCache
config element, so local disk caching can now be disabled in cases where an edge cache is in use. - Added
GetImageInfoAsyncInternal
method toCachingAsyncVirtualPathProvider
, which allows the intercept module to consume image metadata from sources other than image files themselves. This can be useful if the image files are located on remote storage but metadata is available locally e.g. in a database.
MagicScaler v0.10.2.0
MagicScaler v0.10.2
Fixes
- Fixed an issue where column order was swapped in 64bpp CMYK TIFF images when running on .NET Core 3.x with an AVX2-capable processor.
Performance Improvements
- Added SIMD implementations to the hybrid box scaler, improving on speed of the previous SWAR implementations by another 3-4x.
- Aligned pixel buffers where possible, reducing cache-line splits and improving overall SIMD throughput.
- Changed convolution kernel layout to align for SIMD reads, and deduplicated weights to improve cache hit ratio.
- Added small convolution kernel cache to allow weights to be re-used between pipeline stages, such as for identical transforms of Cb and Cr planes.
WebRSize 0.5.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.2.
- Lighter-weight cache hash calculation.
MagicScaler 0.10.1.0
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
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.
MagicScaler 0.9.1.0
- 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
MagicScaler 0.9.0.0
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 acceptSpan<byte>
arguments rather thanIntPtr
and size. This will require code changes to anything consuming raw pixel data from aProcessingPipeline
and to customIPixelSource
andIPixelTransform
implementations. - Changed
ArraySegment<byte>
arguments toReadOnlySpan<byte>
throughout the public API surface. The built-in implicit conversions should make the change seamless. - Changed the name of
BlendingMode.sRGB
toBlendingMode.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
-compatibleColor
class fromSystem.Drawing.Temp
toSystem.Drawing.ColorShim
. This only affectsnetcoreapp1.x
andnetstandard1.x
targets, which are missingSystem.Drawing.Color
from their versions of theSystem.Drawing.Primitives
NuGet package. - Added a
netstandard2.0
target, which usesSystem.Drawing.Color
rather than the compatibility shim. This change should be seamless but may require removing ausing
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 anIPixelTransform
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 withMatteColor
. - Added support for semi-transparent
MatteColor
values. Previously, the alpha value was forced tobyte.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'sIPixelSource
. #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
MagicScaler 0.8.4.0
MagicScaler 0.8.4.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.
WebRSize 0.3.2.0
- 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.