If anyone is still using GD instead of ImageMagick...

Drupal 5.3:

The default scaling and resulting image quality is really terrile using GD Library. However, i found that you can implement sharpening as well. Simply use the function here: http://vikjavev.no/computing/ump.php?id=306

1) paste the sharpening function he provides in to /includes/image.inc
2) Stick the call to the function , $res = UnsharpMask($res, '100', '2', '3'); , after line 496 and right before the line:
if ($extension == 'jpeg') {
return $close_func($res, $destination, variable_get('image_jpeg_quality', 75));

100 = amount of sharpening
2 = radius
3 = threshold
(these numbers can be whatever you like as described on http://vikjavev.no/computing/ump.php?id=306)

Note, i prepended all variables in that funcion with shp_ (ie: $shp_amount , etc) to avoid any potential conflicts.

This works great on my site, and actually offers more granularity than the ImageMagick Advanced Options module, which i had been using.

Comments

Jean-Philippe Fleury’s picture

Any idea how to make it with Drupal 6?

Jean-Philippe Fleury’s picture

I've found: the file in which to insert the function is now includes/image.gd.inc with Drupal 6.