[Mono-aspnet-list] Improve image resizing quality
Daniel Lo Nigro
lists at dan.cx
Sat Mar 16 04:30:05 UTC 2013
Microsoft's .NET Framework uses GDI+ (which is a part of Windows) whereas
Mono uses libgdiplus <http://www.mono-project.com/Libgdiplus> which is a
wrapper around the Cairo graphics library <http://www.cairographics.org/>.
This is why you're seeing differences between the two.
The link you posted uses the ImageMagick library, which is something I'd
recommend if you're not happy with the quality of the System.Drawing
output. ImageMagick (or GraphicsMagick, which is a fork of it) is what I
use with PHP and Node.js and it works pretty well. If you don't want to
mess around with P/Invoke and native libraries, you could just use
System.Diagnostics.Process to run ImageMagick. Just get it working
perfectly from the command-line, and then copy the command into your app :).
See the ImageMagick docs: http://www.imagemagick.org/Usage/resize/#resize
On Sat, Mar 16, 2013 at 4:47 AM, Patrick Epstein <epstone2 at gmail.com> wrote:
> I'm resizing images with the same c# code on windows and linux and the
> results on linux are worse. Just a bit less than acceptable.
> What should I do to get comparable good results?
> What I'm doing right now:
> var resized = resizedImage = image.GetThumbnailImage(width, height,
> null, IntPtr.Zero);
> var encoderParameters = new EncoderParameters(1);
> encoderParameters.Param = new
> EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 90);
> Or is this the way to go?
> Best regards,
> Mono-aspnet-list mailing list
> Mono-aspnet-list at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-aspnet-list