[Mono-aspnet-list] Improve image resizing quality

Patrick Epstein Patrick.Epstein at gmx.de
Sat Mar 16 10:29:22 UTC 2013


Thank you both for your fast answers! I'm using now the technique described
in your blog article and it works fine. :) My ImageMagick downsized jpeg
images are still a tiny bit less sharp than GDI+ but filesize is also
smaller like 30-40%. I'm happy with that for now! Image resizing seems to
be a big topic anyways if I look at that ImageMagick documentation about
that.

Best regards
Patrick

2013/3/16 Daniel Lo Nigro <lists at dan.cx>

> 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:
>
>> Hello,
>>
>> 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:
>>
>>  image.RotateFlip(System.Drawing.RotateFlipType.Rotate180FlipNone);
>>  image.RotateFlip(System.Drawing.RotateFlipType.Rotate180FlipNone);
>>
>> var resized  =  resizedImage = image.GetThumbnailImage(width, height,
>> null, IntPtr.Zero);
>>
>>  var encoderParameters = new EncoderParameters(1);
>>  encoderParameters.Param[0] = new
>> EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 90);
>>
>> saving...
>>
>> Or is this the way to go?
>>
>> http://www.toptensoftware.com/Articles/17/High-Quality-Image-Resampling-in-Mono-Linux
>>
>> Best regards,
>> Patrick
>>
>> _______________________________________________
>> Mono-aspnet-list mailing list
>> Mono-aspnet-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-aspnet-list
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-aspnet-list/attachments/20130316/13c1e3d8/attachment.html>


More information about the Mono-aspnet-list mailing list