High quality image re-sampling in Mono/C#/ASP.NET

2019-07-09 07:25发布

问题:

I've developed a site that requires high quality resizing of uploaded photos. The site works perfectly under ASP.NET on Windows. This afternoon I tried running it under Mono/Apache/Ubuntu 10.10. To my surprise, it worked - except for the image resampling.

It seems the libraries underlying Mono's Graphics/GDI+ implementation don't implement the bi-cubic interpolation mode. (See Mono Ignores Graphics.InterpolationMode? ).

So I'm looking for a library that can do high quality image resizing. I'm willing to put in the effort to interop to it from C# since this is important functionality and I'd like to be able to run under mono if at all possible. I don't really need any other graphics processing capabilities - just resize.

Follow up: as suggested below ImageMagick works really well for this and was pretty easy to interop to. More details here: http://www.toptensoftware.com/blog/posts/17/high-quality-image-resampling-in-monolinux

回答1:

ImageMagick is both a command line tool and a library with high quality interpolation and antialiasing algorithms.