You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/main.md
+61-13Lines changed: 61 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,8 @@ Enables MagicImageProcessor's planar format pipeline for images stored in planar
9
9
Most image processing software will convert YCbCr JPEG input to RGB for processing and then convert back to YCbCr for JPEG output. In addition to saving the processing time spent on this unnecessary conversion, planar processing allows for other work savings.
10
10
11
11
*[Chroma subsampled](https://en.wikipedia.org/wiki/Chroma_subsampling) images do not need to have their chroma planes upsampled to the luma size, only to have them rescaled again. MagicScaler can scale the subsampled chroma plane directly to its final size.
12
-
* When saving in a chroma subsampled format, the final chroma scaling is done with a high-quality resampler rather than the Linear resampler used by the encoder.
13
-
* When processing in [linear light](http://web.archive.org/web/20160826144709/http://www.4p8.com/eric.brasseur/gamma.html), gamma correction needs only be performed on the luma plane.
12
+
* When saving in a chroma subsampled format, the final chroma scaling is done with a high-quality resampler rather than the default resampler used by the encoder.
13
+
* When processing in [linear light](http://www.ericbrasseur.org/gamma.html), gamma correction needs only be performed on the luma plane.
14
14
* When sharpening is applied, it also needs only be performed on the luma plane.
15
15
16
16
This feature is only available if WIC supports it (Windows 8.1/Windows Server 2012 and above) and the input image format is YCbCr. The output results will be slightly different than those produced with RGB processing but no less correct or visually appealing.
@@ -19,21 +19,21 @@ Default Value: true
19
19
20
20
### EnableSimd : static bool
21
21
22
-
Enables [SIMD](https://en.wikipedia.org/wiki/SIMD) versions of MagicScaler's image convolution and matting/compositing algorithms. For high-quality resampling, SIMD processing yields significant performance improvements. This is most notable with linear light processing, which now has no performance penalty compared with sRGB processing.
23
-
24
-
If processing predominately with low-quality resampling or in sRGB blending mode, there can be a slight performance penalty for SIMD processing. You can disable this if your use cases do not follow the high-quality MagicScaler defaults.
22
+
Enables [SIMD](https://en.wikipedia.org/wiki/SIMD) versions of many of MagicScaler's algorithms. For high-quality resampling, SIMD processing yields significant performance improvements.
25
23
26
24
Note that the SIMD processing is done in floating point whereas the standard processing is done in fixed point math. This will result in very slight output differences due to rounding. Differences will not be visually significant but can be detected with a binary compare.
27
25
26
+
This property should only be used for testing/troubleshooting. Forcing floating point processing on incompatible hardware or runtimes will result in very poor performance, and disabling it when supported will sacrifice much of MagicScaler's current and future optimization.
27
+
28
28
Default Value: true if the runtime/JIT and hardware support hardware-accelerated System.Numerics.Vectors, otherwise false
Accepts a file path for the input image, a stream for the output image, and a [ProcessImageSettings](#processimagesettings) object for settings. The output stream must allow Seek and Write. Returns a [ProcessImageResult](#processimageresult).
Accepts a byte ArraySegment for the input image, a stream for the output image, and a [ProcessImageSettings](#processimagesettings) object for settings. The output stream must allow Seek and Write. Returns a [ProcessImageResult](#processimageresult).
36
+
Accepts a ReadOnlySpan for the input image, a stream for the output image, and a [ProcessImageSettings](#processimagesettings) object for settings. The output stream must allow Seek and Write. Returns a [ProcessImageResult](#processimageresult).
@@ -47,9 +47,9 @@ Accepts an [IPixelSource](#ipixelsource) input, a stream for the output image, a
47
47
48
48
Accepts a file path for the input image and a [ProcessImageSettings](#processimagesettings) object for settings. Returns a [ProcessingPipeline](#processingpipeline) for custom processing.
Accepts a byte ArraySegment for the input image and a [ProcessImageSettings](#processimagesettings) object for settings. Returns a [ProcessingPipeline](#processingpipeline) for custom processing.
52
+
Accepts a ReadOnlySpan for the input image and a [ProcessImageSettings](#processimagesettings) object for settings. Returns a [ProcessingPipeline](#processingpipeline) for custom processing.
53
53
54
54
### BuildPipeline(Stream, ProcessImageSettings)
55
55
@@ -187,6 +187,18 @@ An [UnsharpMaskSettings](#unsharpmasksettings) object specifying sharpening sett
187
187
188
188
Default value: unset
189
189
190
+
### ColorProfileMode : ColorProfileMode
191
+
192
+
A [ColorProfileMode](#colorprofilemode) value indicating how embedded [ICC Color Profiles](https://en.wikipedia.org/wiki/ICC_profile) are handled during processing.
193
+
194
+
Default value: Normalize
195
+
196
+
### OrientationMode : OrientationMode
197
+
198
+
An [OrientationMode](#orientationmode) value indicating how [Exif Orientation](https://magnushoff.com/jpeg-orientation.html) correction is handled during processing.
199
+
200
+
Default value: Normalize
201
+
190
202
## CropAnchor
191
203
192
204
A flags enumeration for specifying auto-crop anchor.
@@ -255,11 +267,11 @@ An enumeration for specifying the light blending mode used for high-quality scal
255
267
256
268
### Linear
257
269
258
-
Perform the high-quality scaling in [linear light](http://web.archive.org/web/20160826144709/http://www.4p8.com/eric.brasseur/gamma.html) colorspace. This will give better results in most cases but at a performance cost.
270
+
Convert values to linear RGB before blending. This is more [mathematically correct](http://blog.johnnovak.net/2016/09/21/what-every-coder-should-know-about-gamma/) and more visually pleasing in most cases.
259
271
260
-
### sRGB
272
+
### Companded
261
273
262
-
Perform the high-quality scaling in gamma-corrected sRGB colorspace. This will yield output more similar to other scaling software but will be less correct in most cases.
274
+
Blend companded R'G'B' values directly. This is usually a poor choice but may be used for compatibility with other software or where speed is more important than image quality.
263
275
264
276
## ChromaSubsampleMode
265
277
@@ -313,6 +325,42 @@ JPEG. Use JpegQuality and JpegSubsampleMode settings to control output.
313
325
314
326
Uncompressed 24-bit or 32-bit TIFF, depending on whether or not the input image contains an alpha channel.
315
327
328
+
## ColorProfileMode
329
+
330
+
An enumeration for indicating how embedded [ICC Color Profiles](https://en.wikipedia.org/wiki/ICC_profile) are handled.
331
+
332
+
### Normalize
333
+
334
+
Convert the input image to the [sRGB color space](https://en.wikipedia.org/wiki/SRGB) during processing. Output an untagged sRGB image.
335
+
336
+
### NormalizeAndEmbed
337
+
338
+
Convert the input image to the sRGB color space during processing. Embed a [compact sRGB profile](https://github.com/saucecontrol/Compact-ICC-Profiles) in the output. This option ensures maximum compatibility with web browsers and other software but results slightly larger (+456 bytes) output files.
339
+
340
+
### Preserve
341
+
342
+
Preserve the input image color space during processing. Embed the ICC profile in the output image. If the output format does not support embedded profiles, it will be discarded. Use this option only if the output format and viewing software support color management.
343
+
344
+
### Ignore
345
+
346
+
Ignore any embedded profiles and treat the image as sRGB data. Do not tag the output image. This option may result in significant changes to output color and should only be used if the embedded profile is known to be incorrect.
347
+
348
+
## OrientationMode
349
+
350
+
An enumeration for indicating how [Exif Orientation](https://magnushoff.com/jpeg-orientation.html) is handled.
351
+
352
+
### Normalize
353
+
354
+
Correct the image orientation according to the Exif tag on load. Save the output in normal orientation. This option ensures maximum compatibility with viewer software.
355
+
356
+
### Preserve
357
+
358
+
Preserve the orientation of the input image and tag the output image to reflect the orientation. If the output format does not support orientation tagging, it will be discarded. Use this option only if the output format and viewing software support orientation correction.
359
+
360
+
### Ignore
361
+
362
+
Ignore any orientation tag and treat the image as if its stored orientation is normal. Do not tag the output image. This option should only be used if the Exif orientation of the input image is known to be incorrect.
363
+
316
364
## UnsharpMaskSettings
317
365
318
366
A structure for specifying the settings used for the post-resize [sharpening](https://en.wikipedia.org/wiki/Unsharp_masking) of the output image. These settings are designed to function similarly to the Unsharp Mask settings in Photoshop.
@@ -505,4 +553,4 @@ True if the image frame has a separate alpha channel or if it is in an indexed f
505
553
506
554
### ExifOrientation: Orientation
507
555
508
-
The [Exif Orientation](http://www.impulseadventure.com/photo/exif-orientation.html) value stored for this image frame. The Width and Height values are pre-corrected according to this value, so you can ignore it if you are using MagicScaler to process the image, as it performs orientation correction automatically. The integer values defined in the Orientation enumeration match the stored Exif values.
556
+
The [Exif Orientation](https://magnushoff.com/jpeg-orientation.html) value stored for this image frame. The Width and Height values are pre-corrected according to this value, so you can ignore it if you are using MagicScaler to process the image, as it performs orientation correction automatically. The integer values defined in the Orientation enumeration match the stored Exif values.
Copy file name to clipboardExpand all lines: readme.md
+1-16Lines changed: 1 addition & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,21 +65,6 @@ WebRSize must be configured in your application's web.config file. It will not
65
65
See the [documentation page](doc/web.md) for more details.
66
66
67
67
68
-
Release History
69
-
---------------
70
-
#### MagicScaler 0.8.4.0
71
-
* Fixed an issue that caused sharpening to be a no-op when working with some pixel formats in sRGB blending mode.
72
-
* Improved quality of scaling and sharpening with partially-transparent images.
73
-
* Added [GitLink](https://github.com/GitTools/GitLink) to enable github source server support for debugging.
74
-
75
-
#### WebRSize 0.3.2.0
76
-
* Fixed incorrect file extension for 404 images in the disk cache
77
-
* Added exception handler for "Client Disconnected" errors when transmitting images from the HttpHandler
78
-
* Added devicePixelRatio (dpr) setting to enable automatic size and quality adjustments for retina clients
79
-
* Added "q" shortcut for quality setting
80
-
81
-
See the [releases page](https://github.com/saucecontrol/PhotoSauce/releases) for previous updates.
82
-
83
68
Versioning
84
69
----------
85
70
@@ -88,7 +73,7 @@ This project is using [semantic versioning](http://semver.org/). Releases witho
88
73
Contributing
89
74
------------
90
75
91
-
Because this project is still under active design and development, I am not accepting unsolicited pull requests at this time. If you find a bug or would like to see a new feature implemented, please open a new issue for further discussion. This will hopefully save any wasted or duplicate efforts. If we can agree on a direction, help would be most welcome.
76
+
Contributions are welcome, but please open a new issue for discussion before submitting any pull requests. This will hopefully save any wasted or duplicate efforts.
@@ -21,17 +35,26 @@ public FrameInfo(int width, int height, bool hasAlpha, Orientation orientation)
21
35
}
22
36
}
23
37
38
+
/// <summary>The size of the image container in bytes.</summary>
24
39
publiclongFileSize{get;privateset;}
40
+
/// <summary>The last modified date of the image container, if applicable.</summary>
25
41
publicDateTimeFileDate{get;privateset;}
42
+
/// <summary>The format of the image container (e.g. JPEG, PNG).</summary>
26
43
publicFileFormatContainerType{get;privateset;}
44
+
/// <summary>One or more <see cref="FrameInfo" /> instances describing each image frame in the container.</summary>
27
45
publicFrameInfo[]Frames{get;privateset;}
28
46
47
+
/// <summary>Constructs a new <see cref="ImageFileInfo" /> instance with a single frame of the specified <paramref name="width" /> and <paramref name="height" />.</summary>
48
+
/// <param name="width">The width of the image frame in pixels.</param>
49
+
/// <param name="height">The height of the image frame in pixels.</param>
/// <summary>Constructs a new <see cref="ImageFileInfo" /> instance by reading the metadata from an image file contained in a <see cref="ReadOnlySpan{T}" />.</summary>
75
+
/// <param name="imgBuffer">The buffer containing the image data.</param>
76
+
/// <param name="lastModified">The last modified date of the image container.</param>
/// <summary>Constructs a new <see cref="ImageFileInfo" /> instance by reading the metadata from an image file exposed by a <see cref="Stream" />.</summary>
92
+
/// <param name="imgStream">The stream containing the image data.</param>
93
+
/// <param name="lastModified">The last modified date of the image container.</param>
0 commit comments