diff --git a/src/Magick.NET.Core/IMagickImage.cs b/src/Magick.NET.Core/IMagickImage.cs
index b0fa54b3cf..6d76972902 100644
--- a/src/Magick.NET.Core/IMagickImage.cs
+++ b/src/Magick.NET.Core/IMagickImage.cs
@@ -369,22 +369,6 @@ public partial interface IMagickImage : IMagickImageCreateOperations, IDisposabl
/// Thrown when an error is raised by ImageMagick.
void BrightnessContrast(Percentage brightness, Percentage contrast, Channels channels);
- ///
- /// Uses a multi-stage algorithm to detect a wide range of edges in images.
- ///
- /// Thrown when an error is raised by ImageMagick.
- void CannyEdge();
-
- ///
- /// Uses a multi-stage algorithm to detect a wide range of edges in images.
- ///
- /// The radius of the gaussian smoothing filter.
- /// The sigma of the gaussian smoothing filter.
- /// Percentage of edge pixels in the lower threshold.
- /// Percentage of edge pixels in the upper threshold.
- /// Thrown when an error is raised by ImageMagick.
- void CannyEdge(double radius, double sigma, Percentage lower, Percentage upper);
-
///
/// Charcoal effect image (looks like charcoal sketch).
///
diff --git a/src/Magick.NET.Core/IMagickImageCreateOperations.cs b/src/Magick.NET.Core/IMagickImageCreateOperations.cs
index 9858dc920a..675120858b 100644
--- a/src/Magick.NET.Core/IMagickImageCreateOperations.cs
+++ b/src/Magick.NET.Core/IMagickImageCreateOperations.cs
@@ -275,6 +275,22 @@ public interface IMagickImageCreateOperations
/// Thrown when an error is raised by ImageMagick.
void Border(Percentage percentage);
+ ///
+ /// Uses a multi-stage algorithm to detect a wide range of edges in images.
+ ///
+ /// Thrown when an error is raised by ImageMagick.
+ void CannyEdge();
+
+ ///
+ /// Uses a multi-stage algorithm to detect a wide range of edges in images.
+ ///
+ /// The radius of the gaussian smoothing filter.
+ /// The sigma of the gaussian smoothing filter.
+ /// Percentage of edge pixels in the lower threshold.
+ /// Percentage of edge pixels in the upper threshold.
+ /// Thrown when an error is raised by ImageMagick.
+ void CannyEdge(double radius, double sigma, Percentage lower, Percentage upper);
+
///
/// Resize image to specified size.
///
diff --git a/src/Magick.NET/MagickImage.CloneMutator.cs b/src/Magick.NET/MagickImage.CloneMutator.cs
index 50c5331403..2f406fc323 100644
--- a/src/Magick.NET/MagickImage.CloneMutator.cs
+++ b/src/Magick.NET/MagickImage.CloneMutator.cs
@@ -141,6 +141,12 @@ public void Border(uint width, uint height)
public void Border(Percentage percentage)
=> Border((uint)(NativeMagickImage.Width_Get() * percentage), (uint)(NativeMagickImage.Height_Get() * percentage));
+ public void CannyEdge()
+ => CannyEdge(0.0, 1.0, new Percentage(10), new Percentage(30));
+
+ public void CannyEdge(double radius, double sigma, Percentage lower, Percentage upper)
+ => SetResult(NativeMagickImage.CannyEdge(radius, sigma, lower.ToDouble() / 100, upper.ToDouble() / 100));
+
public void Resize(uint width, uint height)
=> Resize(new MagickGeometry(width, height));
diff --git a/src/Magick.NET/MagickImage.cs b/src/Magick.NET/MagickImage.cs
index cdb077a110..78da972c3b 100644
--- a/src/Magick.NET/MagickImage.cs
+++ b/src/Magick.NET/MagickImage.cs
@@ -1440,7 +1440,10 @@ public void BrightnessContrast(Percentage brightness, Percentage contrast, Chann
///
/// Thrown when an error is raised by ImageMagick.
public void CannyEdge()
- => CannyEdge(0.0, 1.0, new Percentage(10), new Percentage(30));
+ {
+ using var mutator = new Mutator(_nativeInstance);
+ mutator.CannyEdge();
+ }
///
/// Uses a multi-stage algorithm to detect a wide range of edges in images.
@@ -1451,7 +1454,10 @@ public void CannyEdge()
/// Percentage of edge pixels in the upper threshold.
/// Thrown when an error is raised by ImageMagick.
public void CannyEdge(double radius, double sigma, Percentage lower, Percentage upper)
- => _nativeInstance.CannyEdge(radius, sigma, lower.ToDouble() / 100, upper.ToDouble() / 100);
+ {
+ using var mutator = new Mutator(_nativeInstance);
+ mutator.CannyEdge(radius, sigma, lower, upper);
+ }
///
/// Charcoal effect image (looks like charcoal sketch).
diff --git a/src/Magick.NET/Native/MagickImage.cs b/src/Magick.NET/Native/MagickImage.cs
index 4af2f5d5be..a16c7304f8 100644
--- a/src/Magick.NET/Native/MagickImage.cs
+++ b/src/Magick.NET/Native/MagickImage.cs
@@ -281,8 +281,7 @@ private unsafe sealed partial class NativeMagickImage : NativeInstance, INativeM
public partial void BrightnessContrast(double brightness, double contrast, Channels channels);
[Throws]
- [SetInstance]
- public partial void CannyEdge(double radius, double sigma, double lower, double upper);
+ public partial IntPtr CannyEdge(double radius, double sigma, double lower, double upper);
public partial nuint ChannelOffset(PixelChannel channel);