[Mono-list] System.Drawing.Graphics - Saved image quality

Sebastien Pouliot sebastien.pouliot at gmail.com
Thu Mar 29 15:59:37 EDT 2007


On Thu, 2007-03-29 at 12:30 -0700, steini wrote:
> Hi,
> 
> I have been working on a web application that is saving photos and and
> creating thumbnails.
> The photos are saved properly but the generated thumbnails have poor
> quality.
> 
> This has been developed on windows but is running on Linux / mod_mono and
> thumbnails are generated in high quality on the developement machine.
> 
> Im using the Graphics object to create the thumbnails and configuring the
> InterpolationMode, CompositingQuality and SmoothingMode but all of the
> thumbnails created on the server have really poor quality.
> 
> Any ideas what might be the problem?

Several ;-)

System.Drawing expose all options that MS GDI+ offers but outside
Windows libgdiplus is being used. In this case libgdiplus maps all
options to what exists inside Cairo.

InterpolationMode was fixed in January (not 100% sure this was in
libgdiplus 1.2.3 or not). You can see the mapping between GDI+/cairo in
the bug report: http://bugzilla.ximian.com/show_bug.cgi?id=77181

CompositingQuality has no match inside Cairo. Changing this value won't
change the output.

SmoothingMode is split in two like this:
	SmoothingModeAntiAlias
	SmoothingModeHighQuality
		CAIRO_ANTIALIAS_DEFAULT
	SmoothingModeNone
	SmoothingModeDefault
	SmoothingModeHighSpeed
		CAIRO_ANTIALIAS_NONE

Hopefully you can find something working for you in those settings.
-- 
Sebastien Pouliot  <sebastien at ximian.com>
Blog: http://pages.infinit.net/ctech/



More information about the Mono-list mailing list