Exemplo n.º 1
0
 public override void Apply(MagickImage image)
 {
     if (Radius > 0)
     {
         image.AdaptiveBlur(Radius);
     }
 }
Exemplo n.º 2
0
        private void AdaptiveBlurImage(MagickImage image)
        {
            if (AdaptiveBlur == 0.0)
            {
                return;
            }

            image.AdaptiveBlur(AdaptiveBlur, 1.0);
        }
Exemplo n.º 3
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
            });
        }
Exemplo n.º 4
0
            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
                }
            }
Exemplo n.º 5
0
            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);
                    }
                }
            }