Different conversion result for .Net and node.js library

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
esafonchik
Posts: 1
Joined: 2019-04-02T02:05:28-07:00
Authentication code: 1152

Different conversion result for .Net and node.js library

Post by esafonchik »

Hi!

I'm trying to reproduce node.js conversion through .Net library, but the result is very different.

original js code - s.flatten().filter('Box').define('filter:blur=0').resize(imageSize, imageSize)

c# code -

Code: Select all

using (IMagickImage image = images.Flatten())
                {

                    image.FilterType = FilterType.Box;

                    image.Blur(0);

                    image.Resize(size, size);
}
I d'not know how to make the results identical. Can somebody help me?

Thanks!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Different conversion result for .Net and node.js library

Post by snibgo »

Your js code has a define 'filter:blur=0' with the effect of sharpening at the resize. See http://www.imagemagick.org/script/comma ... php#filter


Your c# code doesn't do this. Instead, it performs a blur.
snibgo's IM pages: im.snibgo.com
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Different conversion result for .Net and node.js library

Post by dlemstra »

You will need to do image.SetArtifact("filter:blur", "0") instead of image.Blur(0);
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
Post Reply