94

I am in the step to abandon GD for manipulating image in my website - it is awful.

Everyone saying to use ImageMagick because they are better than GD, but what about ImageMagick vs Gmagick (Swiss Army knife of image processing)?

Zend has a pretty article here http://devzone.zend.com/article/10531 talking about them.

Before I will leave for ImageMagick are there any motivation to use gmagick instead?

(PHP 5.3+)

Edit: What's wrong with asking which is better between 2 libs? I think it's a fair question. If someone could explain the good-point of one lib over the other would help me and other people reading this question. Why close such a question??

Edit2: For everyone asking what I need to do: I think it's oblivious: users uploads images (than can be png/gif/bmp w/e) I need to convert in JPG and then store it in the database, eventually if they are too big I need to resize down them a bit.

Thanks

Joseph at SwiftOtter
  • 4,276
  • 5
  • 37
  • 55
dynamic
  • 46,985
  • 55
  • 154
  • 231
  • 1
    For the poeple with the close button too easy: there aren't any Question Or Answer to this – dynamic Mar 12 '11 at 10:57
  • 1
    @col: I just want to know which is better.. I can say ImageMagick are better than GD, and now I would like to compare I.M. with G.magick.. It's a fair question.! – dynamic Mar 12 '11 at 10:58
  • @col: and if you know some motivation to use one instead of another your are welcome to make an Answer. It's completly useless to hit Close whenever someone don't like a question! – dynamic Mar 12 '11 at 11:00
  • Agree with the Colonel. The right tool for the job. If we don't know the job, the tool cannot be determined. – Wrikken Mar 12 '11 at 11:02
  • @wrikken: i thought for a website it's oblivious what i need to do, anyway i added second edit to explain – dynamic Mar 12 '11 at 11:04
  • @Col: in this case i am not asking sometihng "personal" an algo compared to another that does the same thing can be objectively better or worse. Like the comparison between GD and ImageMagick! If someone ask "Which is better between GD and ImageMagick" the reply is easy! Now i need to know for the other 2 libs. – dynamic Mar 12 '11 at 11:05
  • @yes123: you mean obvious? Have you any idea what a plethora of possible image manipulations are possible? And if there is such a thing as objectively better or worse it should be quantifiable, so ask that: which one is more supported, easier to install, supports feature X, is faster for a _very specific_ task, etc. etc. (which you can easily determine by actually measuring it). – Wrikken Mar 12 '11 at 11:10
  • @wrikken: good point I added what i need to do in the question (just convert or resize) – dynamic Mar 12 '11 at 11:12
  • while gd is different, gmagick is pretty the same as Imagick. I doubt it worth to dig deep to find slight differencies. Just go and use whatever you wish – Your Common Sense Mar 12 '11 at 11:15
  • @col: that's what I would have liked to hear as Answer.. let's wait for someone other opinion too. (and leave that close -.-) – dynamic Mar 12 '11 at 11:18
  • Related: http://www.linux.com/archive/articles/59223 – Pekka Mar 12 '11 at 11:45
  • 9
    It is a valid question. – Strong Like Bull May 11 '13 at 17:43

2 Answers2

54

According to Wikipedia, GraphicsMagick is a fork from ImageMagick 5.5.2.

As far as I can see, GMagick comes with no new features; the fork is concentrating on better performance and stability, which as @Col says you should test and compare yourself.

From a feature perspective, if a library is needed for more than just basic resizing and cropping operations, I personally would prefer ImageMagick any day because of the vast, well-documented and illustrated library of thousands of examples which work very well. GraphicsMagick does not seem to have documentation of similar quality.

It's also likely that GMagick does not have whatever new features were added to IM since version 5.5.2. It may be worth checking out the ImageMagick change logs whether you're missing out on anything you need.

On a highly subjective note, ImageMagick is definitely the more popular and well-known library, and you are likely to find more support, examples and scripts for it. Also I doubt whether the performance differences are going to really make a difference in most use cases - in my experience over the past ten years, IM is not the fastest, but also not the slowest of graphics processing libraries and perfectly suitable for most everyday uses.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
8

What is it you don't like about GD? Is it the API, is it missing features or is it performance?

Perhaps you can try the graphics library imagine - it has a nice, clean OOP API and can uses GD, ImageMagick and GraphicsMagick as "backends". This way you can also test which library has the best performance, without having to change your image manipulation code.

chiborg
  • 26,978
  • 14
  • 97
  • 115
  • 6
    One problem of gd it is memory usage. For a 12Mb jpeg will create a 100Mb resource. Also if you want fast resize, crop or thumb (crop and resize) you will have right away this tools. Not mentioning all effects. – catalinux Feb 07 '13 at 07:26
  • @catalinux I concur. In 2022 now with GD on one of my sites, a complex 1080p webp image blows up to 600mb to convert to ~600p for a page. A set of 10 consecutive png thumbnails processed back-to-back on the same request blows out my 1GB limit and 500 errors, ....with no other requests going. Just watching top on a low use site. Switching back to imagick no issue. I wanted the webp support in GD with the newer 7.4 alt but its no good for web serving. Been trying for 6 months doing every possible way. Ill try again in a year. Its not every image, some specific images or scenarios loses its mind. – Beeeaaar Aug 05 '22 at 18:06
  • @celess in 2022 there other ways to generate thumbnails on the fly for websites: like cloudflare or thumbor – catalinux Sep 02 '22 at 20:22