diff --git a/src/Magick.NET.Core/IMagickImage.cs b/src/Magick.NET.Core/IMagickImage.cs index 245c90f0cc..a519354840 100644 --- a/src/Magick.NET.Core/IMagickImage.cs +++ b/src/Magick.NET.Core/IMagickImage.cs @@ -1322,12 +1322,6 @@ public partial interface IMagickImage : IMagickImageCreateOperations, IDisposabl /// Thrown when an error is raised by ImageMagick. void MedianFilter(uint radius); - /// - /// Reduce image by integral size. - /// - /// Thrown when an error is raised by ImageMagick. - void Minify(); - /// /// Returns the points that form the minimum bounding box around the image foreground objects with /// the "Rotating Calipers" algorithm. he method also returns these properties: minimum-bounding-box:area, diff --git a/src/Magick.NET.Core/IMagickImageCreateOperations.cs b/src/Magick.NET.Core/IMagickImageCreateOperations.cs index 09a93ddbcb..3437996257 100644 --- a/src/Magick.NET.Core/IMagickImageCreateOperations.cs +++ b/src/Magick.NET.Core/IMagickImageCreateOperations.cs @@ -724,6 +724,12 @@ public interface IMagickImageCreateOperations /// The color distance. void MeanShift(uint width, uint height, Percentage colorDistance); + /// + /// Reduce image by integral size. + /// + /// Thrown when an error is raised by ImageMagick. + void Minify(); + /// /// Resize image to specified size. /// diff --git a/src/Magick.NET/MagickImage.CloneMutator.cs b/src/Magick.NET/MagickImage.CloneMutator.cs index 08a1ee4a08..d4f129a188 100644 --- a/src/Magick.NET/MagickImage.CloneMutator.cs +++ b/src/Magick.NET/MagickImage.CloneMutator.cs @@ -398,6 +398,9 @@ public void MeanShift(uint width, uint height) public void MeanShift(uint width, uint height, Percentage colorDistance) => SetResult(NativeMagickImage.MeanShift(width, height, PercentageHelper.ToQuantum(nameof(colorDistance), colorDistance))); + public void Minify() + => SetResult(NativeMagickImage.Minify()); + public void LiquidRescale(Percentage percentageWidth, Percentage percentageHeight, double deltaX, double rigidity) { var geometry = new MagickGeometry(percentageWidth, percentageHeight); diff --git a/src/Magick.NET/MagickImage.cs b/src/Magick.NET/MagickImage.cs index 511fa3ca39..697d78b763 100644 --- a/src/Magick.NET/MagickImage.cs +++ b/src/Magick.NET/MagickImage.cs @@ -4126,7 +4126,10 @@ public void MedianFilter(uint radius) /// /// Thrown when an error is raised by ImageMagick. public void Minify() - => _nativeInstance.Minify(); + { + using var mutator = new Mutator(_nativeInstance); + mutator.Minify(); + } /// /// Returns the points that form the minimum bounding box around the image foreground objects with diff --git a/src/Magick.NET/Native/MagickImage.cs b/src/Magick.NET/Native/MagickImage.cs index d892d17f82..a6c1ad0014 100644 --- a/src/Magick.NET/Native/MagickImage.cs +++ b/src/Magick.NET/Native/MagickImage.cs @@ -523,8 +523,7 @@ private unsafe sealed partial class NativeMagickImage : NativeInstance, INativeM public partial IntPtr MeanShift(nuint width, nuint height, double colorDistance); [Throws] - [SetInstance] - public partial void Minify(); + public partial IntPtr Minify(); [Throws] [Cleanup(Name = "ImageMagick.Moments.DisposeList")]