public override void Apply(MagickImage image) { if (Radius > 0) { image.AdaptiveBlur(Radius); } }
private void AdaptiveBlurImage(MagickImage image) { if (AdaptiveBlur == 0.0) { return; } image.AdaptiveBlur(AdaptiveBlur, 1.0); }
public async Task Write(MagickImage image, Stream outputStream) { image.Quality = this.quality; image.Interlace = Interlace.Jpeg; image.AdaptiveBlur(0.05); await image.WriteAsync(outputStream, new JpegWriteDefines { SamplingFactor = JpegSamplingFactor.Ratio420, DctMethod = JpegDctMethod.Float }); }
public void ShouldBlurTheImage() { using (var image = new MagickImage(Files.MagickNETIconPNG)) { image.AdaptiveBlur(10, 5); #if Q8 || Q16 ColorAssert.Equal(new MagickColor("#a872dfb1f8ddfe8b"), image, 56, 68); #else ColorAssert.Equal(new MagickColor("#a8a8dfdff8f8"), image, 56, 68); #endif } }
public void ShouldUseTheCorrectDefaultValuesWithRadius() { using (var imageA = new MagickImage(Files.MagickNETIconPNG)) { using (var imageB = imageA.Clone()) { imageA.AdaptiveBlur(2.0); imageB.AdaptiveBlur(2.0, 1.0); var distortion = imageA.Compare(imageB, ErrorMetric.RootMeanSquared); Assert.Equal(0.0, distortion); } } }