3

I'm going to write a function for thumbnail creation.
I can use both Imagemagick & GD Library methods.
Which method creates better thumbnails and is faster and better for server (load, ...)?

Thanks

Ariyan
  • 14,760
  • 31
  • 112
  • 175

3 Answers3

2

GraphicsMagick

After trying both and finding that ImageMagick was better but in the end I choose neither and went with GraphicsMagick instead.

GraphicsMagick is originally derived from ImageMagick 5.5.2 as of November 2002 but has been completely independent of the ImageMagick project since then. Since the fork from ImageMagick many improvements have been made (see NEWS) by many authors using an open development model but without breaking the API or utilities operation.

  • GM is more efficient so it gets the job done faster using fewer resources.
  • GM is much smaller and tighter (3-5X smaller installation footprint).
  • GM is used to process billions of files at the world's largest photo sites (e.g. Flickr and Etsy).
  • GM does not conflict with other installed software.
  • GM suffers from fewer security issues and exploits.
  • GM valgrind's 100% clean (memcheck and helgrind).

Also..

Anthony Hatzopoulos
  • 10,437
  • 2
  • 40
  • 57
2

From my experience, I think ImageMagick renders a better quality. It's also known that ImageMagick is faster, specially if you use it throught command line (or PHP exec("convert ...") (see this benchmark for example)

About quality, I've found this, in SO : How to stop GD2 from washing away the colors upon resizing images?

Community
  • 1
  • 1
haltabush
  • 4,508
  • 2
  • 24
  • 41
1
$im = imagecreatefromjpeg('photo.jpg');

$ox = imagesx($im);
$oy = imagesy($im); 

$nx = 320;
$ny = 240;

$nm = imagecreatetruecolor($nx, $ny); 

imagecopyresized($nm,$im,0,0,0,0,$nx,$ny,$ox,$oy); 

imagejpeg($nm, 't_photo.jpg');

VS

exec('convert photo.jpg -resize 320x240 t_photo.jpg');

What do you think?

Also every good thumbnail should be sharpened a bit...

exec('convert photo.jpg -resize 320x240 -unsharp 1.5×1.0+1.5+0.02 t_photo.jpg');

http://net.tutsplus.com/tutorials/php/create-instagram-filters-with-php/

Dejan Marjanović
  • 19,244
  • 7
  • 52
  • 66