Skip to content

Commit

Permalink
0.6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
saucecontrol committed Jan 17, 2017
1 parent 463ac98 commit 076ba5c
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 20 deletions.
22 changes: 11 additions & 11 deletions doc/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,31 @@ Default Value: 0

###Sharpen: bool

Indicates whether an [unsharp mask](https://en.wikipedia.org/wiki/Unsharp_masking) operation should be performed on the image following the resize. The sharpening settings are controlled by the [UnsharpMask](#UnsharpMask) property.
Indicates whether an [unsharp mask](https://en.wikipedia.org/wiki/Unsharp_masking) operation should be performed on the image following the resize. The sharpening settings are controlled by the [UnsharpMask](#unsharpmask-unsharpmasksettings) property.

Default value: false

###ResizeMode: CropScaleMode

A [CropScaleMode](#CropScaleMode) value indicating whether auto-cropping should be performed or whether the resized image may have a different aspect ratio. Auto-cropping is performed only if a [Crop](#Crop) value is not explicitly set.
A [CropScaleMode](#cropscalemode) value indicating whether auto-cropping should be performed or whether the resized image may have a different aspect ratio. Auto-cropping is performed only if a [Crop](#crop-rectangle) value is not explicitly set.

Default value: Crop

###Crop: Rectangle

A System.Drawing.Rectangle that specifies which part of the input image should be included. If the rectangle is empty and the [ResizeMode](#ResizeMode) is set to `Crop`, the image will be cropped automatically. Points given for this rectangle must be expressed in terms of the input image.
A System.Drawing.Rectangle that specifies which part of the input image should be included. If the rectangle is empty and the [ResizeMode](#resizemode-cropscalemode) is set to `Crop`, the image will be cropped automatically. Points given for this rectangle must be expressed in terms of the input image.

Default value: Rectangle.Empty

###Anchor: CropAnchor

A [CropAnchor](#CropAnchor) value indicating the position of the auto-crop rectangle. Values may be combined to specify a vertical and horizontal position. Ex: `myCrop = CropAnchor.Top | CropAnchor.Left`.
A [CropAnchor](#cropanchor) value indicating the position of the auto-crop rectangle. Values may be combined to specify a vertical and horizontal position. Ex: `myCrop = CropAnchor.Top | CropAnchor.Left`.

Default value: CropAnchor.Center

###SaveFormat: FileFormat

A [FileFormat](#FileFormat) value indicating the codec used for the output image. A value of `Auto` will choose the output codec based on the input image type.
A [FileFormat](#fileformat) value indicating the codec used for the output image. A value of `Auto` will choose the output codec based on the input image type.

Default value: FileFormat.Auto

Expand All @@ -82,13 +82,13 @@ Default value: Color.Empty

###HybridMode: HybridScaleMode

A [HybridScaleMode](#HybridScaleMode) value indicating whether hybrid processing is allowed. Hybrid processing may use the image decoder or another low-quality scaler to shrink an image to an intermediate size before the selected high-quality algorithm is applied to the final resize. This can result in dramatic performance improvements but with a reduction in image quality.
A [HybridScaleMode](#hybridscalemode) value indicating whether hybrid processing is allowed. Hybrid processing may use the image decoder or another low-quality scaler to shrink an image to an intermediate size before the selected high-quality algorithm is applied to the final resize. This can result in dramatic performance improvements but with a reduction in image quality.

Default value: HybridScaleMode.FavorQuality

###BlendingMode: GammaMode

A [GammaMode](#GammaMode) value indicating whether the scaling algorithm is applied in linear or gamma-corrected colorspace. Linear processing will yield better quality in almost all cases but with a performance cost.
A [GammaMode](#gammamode) value indicating whether the scaling algorithm is applied in linear or gamma-corrected colorspace. Linear processing will yield better quality in almost all cases but with a performance cost.

Default value: GammaMode.Linear

Expand All @@ -106,19 +106,19 @@ Default value: 0

###JpegSubsampleMode: ChromaSubsampleMode

A [ChromaSubsampleMode](#ChromaSubsampleMode) value indicating how [chroma subsampling](https://en.wikipedia.org/wiki/Chroma_subsampling) is configured in the JPEG encoder for the output image. If this value is set to `Default`, the chroma subsampling will be set automatically based on the [JpegQuality](#JpegQuality) setting.
A [ChromaSubsampleMode](#chromasubsamplemode) value indicating how [chroma subsampling](https://en.wikipedia.org/wiki/Chroma_subsampling) is configured in the JPEG encoder for the output image. If this value is set to `Default`, the chroma subsampling will be set automatically based on the [JpegQuality](#jpegquality-int) setting.

Default value: ChromaSubsampleMode.Default

###Interpolation: InterpolationSettings

An [InterpolationSettings](#InterpolationSettings) object specifying details of the sampling algorithm to use for image scaling. If this value is unset, the algorithm will be chosen automatically based on the ratio of input image size to output image size.
An [InterpolationSettings](#interpolationsettings) object specifying details of the sampling algorithm to use for image scaling. If this value is unset, the algorithm will be chosen automatically based on the ratio of input image size to output image size.

Default value: unset

###UnsharpMask: UnsharpMaskSettings

An [UnsharpMaskSettings](#UnsharpMaskSettings) object specifying sharpening settings. If this value is unset, the settings will be chosen automatically based on the ratio of input image size to output image size.
An [UnsharpMaskSettings](#unsharpmasksettings) object specifying sharpening settings. If this value is unset, the settings will be chosen automatically based on the ratio of input image size to output image size.

Default value: unset

Expand Down Expand Up @@ -153,7 +153,7 @@ Allow the output image Width and Height to change the aspect ratio of the input
###Examples

Suppose you have an input image with dimensions of 640x480 and you set the Width and Height of the output image to 100x100.
`Crop` will produce an output image of 100x100, preserving the aspect ratio of the input image by cropping from the sides of the image. By default, this will crop evenly from the left and right. You can change that behavior by changing the [Anchor](#CropAnchor) value.
`Crop` will produce an output image of 100x100, preserving the aspect ratio of the input image by cropping from the sides of the image. By default, this will crop evenly from the left and right. You can change that behavior by changing the [Anchor](#anchor-cropanchor) value.
`Max` will produce an output image of 100x75, preserving the aspect ratio of the input image by contstraining the dimensions of the output image.
`Stretch` will produce an output image of 100x100 that is squished horizontally.

Expand Down
5 changes: 3 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ MagicScaler brings hig-performance, high-quality image scaling to .NET.
Requirements
------------

Windows 7 SP1 or later*
.NET 4.6 or later
Windows 7* or later with .NET 4.6 or later

*Windows 7 and Windows Sever 2008 R2 are supported only with the [Platform Update](https://support.microsoft.com/en-us/kb/2670838) installed.

Expand Down Expand Up @@ -40,6 +39,8 @@ Release History
---------------

####0.6.0.0
* Fixed invalid color profile error when using hybrid scaling with non-JPEG CMYK images.
* Enabled sharpening by default. This can be disabled with the Sharpen property on ProcessImageSettings.
* Added support for copying metadata from the source image. See the MetadataNames property on ProcessImageSettings.
* Added CubicSmoother preconfigured interpolator.
* Changed Lanczos filter default to 3 lobes. Removed the preconfigured 2-lobe filter and changed the name of Lanczos3 to Lanczos.
Expand Down
2 changes: 1 addition & 1 deletion src/Core/ColorProfileReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal class ColorProfileInfo
public string Creator { get; private set; }
public bool IsValid { get; private set; }

public bool IsDisplayRgb => DataColorSpace == "RGB " && DeviceClass == "mntr";
public bool IsDisplayRgb => DataColorSpace == "RGB " && (DeviceClass == "mntr" || DeviceClass == "cmra" || DeviceClass == "scnr");
public bool IsCmyk => DataColorSpace == "CMYK";
public bool IsStandardSrgb => CMM == "Lino" && Manufacturer == "IEC " && Model == "sRGB";

Expand Down
2 changes: 1 addition & 1 deletion src/Core/ProcessImageSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class ProcessImageSettings
public int FrameIndex { get; set; }
public int Width { get; set; }
public int Height { get; set; }
public bool Sharpen { get; set; }
public bool Sharpen { get; set; } = true;
public CropScaleMode ResizeMode { get; set; }
public Rectangle Crop { get; set; }
public CropAnchor Anchor { get; set; }
Expand Down
6 changes: 3 additions & 3 deletions src/WIC/MagicImageProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ private static void processImage(WicDecoder dec, WicProcessingContext ctx, Strea
using (var cac = new WicConditionalCache(rot))
using (var crp = new WicCropper(cac))
using (var pix = new WicPixelFormatConverter(crp))
using (var res = new WicScaler(pix, true))
using (var cmy = new WicCmykConverter(res))
using (var lll = new WicGammaExpand(cmy))
using (var cmy = new WicCmykConverter(pix))
using (var res = new WicScaler(cmy, true))
using (var lll = new WicGammaExpand(res))
using (var mmm = new WicHighQualityScaler(lll))
using (var mat = new WicMatteTransform(mmm))
using (var ggg = new WicGammaCompress(mat))
Expand Down
3 changes: 2 additions & 1 deletion src/WIC/WicImageProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ private static void processImage(WicDecoder dec, WicProcessingContext ctx, Strea
using (var cac = new WicConditionalCache(rot))
using (var crp = new WicCropper(cac))
using (var pix = new WicPixelFormatConverter(crp))
using (var res = new WicScaler(pix))
using (var cmy = new WicCmykConverter(pix))
using (var res = new WicScaler(cmy))
using (var csc = new WicColorspaceConverter(res))
using (var mat = new WicMatteTransform(csc))
using (var pal = new WicPaletizer(mat, 256))
Expand Down
1 change: 0 additions & 1 deletion src/WIC/WicTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ public WicCmykConverter(WicTransform prev) : base(prev)
if (!Context.IsCmyk)
return;

// TODO 40bppcmyka unsupported -- WIC bug
var trans = AddRef(Wic.CreateColorTransform());
trans.Initialize(Source, Context.SourceColorContext, Context.DestColorContext, Context.HasAlpha ? Consts.GUID_WICPixelFormat32bppBGRA : Consts.GUID_WICPixelFormat24bppBGR);

Expand Down

0 comments on commit 076ba5c

Please sign in to comment.