• Skip to content
  • Skip to primary sidebar
  • Skip to footer

Foliovision

Main navigation

  • Weblog
    • FV Player
    • WordPress
    • Video of the Week
    • Case Studies
    • Business
  • About
    • Testimonials
    • Meet the Team
    • We Support
    • Careers
    • Contact
    • Pricing
  • Products
  • Support
    • FV Player Docs
    • Pro Support
  • Login
  • Basket is empty
Affordable VAST/VPAID for Wordpress has arrived. Serve ads with your videos starting today!

ImageMagick vs GD vs Photoshop

26 March 2010 / zdenka / 11 Comments

We want to have nice pictures in our posts. So do You. Good composition, colors and focus are by all means necessary. But there’s at least one more step between picture in your camera and picture on your web – resizing. Either on your computer in your own image editor, or on the server using image processor designed for that purpose, or on both.

In this article we will look at the quality of the server-side processing of the pictures when they are being resized. There are two tools for image handling running under php. First is build-in php image processor called GD. Second tool is ImageMagick which needs to be additionally installed on the server.

Focus on Details

If you want really nice pictures, details matter. Details are the magic that makes the picture look extraordinary good. We examined how GD and ImageMagick behave when it comes to details. With GD we don’t have many ways how to affect the result, but with ImageMagick we have the choice of filters and sharpening options. Look at the following portrait and notice the difference. You can see that the GD picture looks somehow blurry while the ImageMagick looks more sharp and preserves details.

GD processed

GD, 32kB
ImageMagick processed

ImageMagick, 63kB
Photoshop processed

Photoshop, 58kB

Details in the following example are even more disturbing in the case of GD. You can clearly see not even the blurriness, but also ugly artifacts around the windows – the set of lines formed by windows is really distracted in the GD case.

GD processed

GD, 29kB
ImageMagick processed

ImageMagick, 65kB
Photoshop processed

Photoshop, 56kB

As you probably already have noticed, the ImageMagick files are significantly bigger than the files produced by GD. This is the price we are paying for keeping the details. In comparison, Photoshop has slightly smaller files than ImageMagick.

The last example might be not so obvious. We resized the original picture only to 50% of it’s size and cropped part of the face:

GD processed

GD
ImageMagick processed

ImageMagick
Photoshop processed

Photoshop

If you look very carefully you can see the small differences around eyebrows, eyelashes and in the center of the eye.

Sharpening

Another feature provided by ImageMagick is sharpening, while GD does not offer this option. Sharpening is applied during the resizing process, by default no sharpening is used. We already noticed that even this option is turned off, the pictures processed by ImageMagick look more sharp then the ones from GD. Here we offer a closer look at the effect of different sharpening values:

ImageMagick no sharpening

ImageMagick, no sharpening (=1)
ImageMagick sharpening=0.9

ImageMagick, sharpening=0.9
ImageMagick sharpening=0.8

ImageMagick, sharpening=0.8
ImageMagick sharpening=0.5

ImageMagick, sharpening=0.5:
very sharp, too sharp

We can see that slight sharpening (0.9) as used in the top left picture might be sometimes handy, but care should be taken to not use this parameter in extreme values as ugly artifacts come along this process – see the area around eyes or hair in the bottom right picture.

Conclusion

We care about how our pictures look, and so should You. In this comparison we showed that ImageMagick behaves much better when it comes to details and we think that ImageMagick should be used instead of GD whenever possible. We are willing to pay the price of bigger files in favor or preserving details.

Technical note

In this comparison we used the compression quality equal to 100% to not get any form of distraction from the compression algorithms. The filter used in ImageMagick for the resize was the Lanczos filter.

Wanna try it yourself? Here are our test images: building.jpg and girl.jpg

Categories: Design, WordPress

Related Posts

  1. Photoshop CS3 Droplet: Save as GIF

    Photoshop CS3 Droplet: Save as GIF

  2. Image Resizer Faceoff OS X: JPEGmini vs Adobe Photoshop vs PhotoBatcher vs ResizeMe

    Image Resizer Faceoff OS X: JPEGmini vs Adobe Photoshop vs PhotoBatcher vs ResizeMe

  3. How to resize a text logo correctly in Photoshop

    How to resize a text logo correctly in Photoshop

Reader Interactions

Comments

  1. mark c 10 June 2010 at 3:45 pm

    that’s very useful to see this comparison

    however there is a sharpen function in GD – (I haven’t tried it yet) vikjavev.no/computing/ump.php?id=306

    I think you should create two files that are a similar file size – e.g if you leave the GD file of the girl at 32k – then convert using IM until you get a file of 32k … I think the quality will then be the same

    Reply
  2. zdenka 14 June 2010 at 12:20 am

    Hi Mark,

    thanks for your tip. I’ve looked at the link you’ve sent, and you’re right, this piece of code is a sharpening function. But, it is not a build-in GD function, it is an implementation of some sharpening algorithm which uses GD functions. Having the basic image processing functions, you can implement a large variety of functions, and we’re sure there are plenty or them available online. In this comparison we focused at build-in GD functions, that’s why we haven’t used any of these algorithms. GD as well as IMagick have the option of building your own algorithms, but that would lead us into programming the best sharpening algorithms. But this was not our intention. Thanks a lot for digging that piece of code, it’s good to know that somebody already did that!

    Your second tip is also very interesting, we will look at that.

    Reply
  3. Tweak 11 October 2010 at 8:25 am

    You should compare all of them in same size

    Reply
  4. zdenka 11 October 2010 at 8:44 am

    Hi Tweak,

    yes, you’re right, that would be an interesting comparison too. We’ll think about it, thanks for your suggestion.

    Zdenka

    Reply
  5. joey 3 April 2012 at 9:36 am

    You can’t compare the size of a file generated with GD and a file generated with ImageMagick. GD creates a brand new image and loses all the meta informations. ImageMagick preserves the misc infos like the camera brand/model, comments… and the ICC profile, which takes some kb but keeps the color correct. You can suppress these infos of the imagemagick files using jhead, but also use some optimizer which keeps every pixel the same. For example, imageOptim under OS X (which is basically a GUI for a few command line optimizers — free).

    Reply
  6. Avatar photoalec 4 April 2012 at 11:03 am

    Interesting post, Joey but…

    Why again can we not compare the size of a file generated by GD and ImageMagick?

    Reply
  7. Vincent Cohen 5 April 2012 at 6:22 am

    What would you suggest if one does not have ImageMagick available on his/her server?

    I have a client for whom I am building a website with more then a thousand Highres pictures, however ImageMagick is not available.

    Reply
  8. Vincent 5 April 2012 at 11:18 pm

    I was afraid you would say so. Guess there is no other option,

    Thanks a lot for your help, much appreciated.

    Reply
  9. Avatar photoalec 5 April 2012 at 4:10 pm

    Hi Vincent,

    Move servers.

    I would not host an image driven site on a server without ImageMagick. It’s that big a difference.

    Making the web work for you, Alec

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You can click here to Subscribe without commenting

Primary Sidebar

Categories

  • Business
  • Camera Reviews
  • Case Studies
  • Design
  • FV Player
  • Internet Marketing
  • IT
  • Life
  • SEO
  • Slovak
  • Video of the Week
  • WordPress

Footer

Our Plugins

  • FV WordPress Flowplayer
  • FV Thoughtful Comments
  • FV Simpler SEO
  • FV Antispam
  • FV Gravatar Cache
  • FV Testimonials

Free Tools

  • Pandoc Online
  • Article spinner
  • WordPress Password Finder
  • Delete LinkedIn Account
  • Responsive Design Calculator
Foliovision logo
All materials © 2025 Foliovision s.r.o. | Panská 12 - 81101 Bratislava - Slovakia | info@foliovision.com
  • This Site Uses Cookies
  • Privacy Policy
  • Terms of Service
  • Site Map
  • Contact
  • Tel. ‭+421 2/5292 0086‬

We are using cookies to give you the best experience on our website.

You can find out more about which cookies we are using or switch them off in .

Powered by  GDPR Cookie Compliance
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Necessary Cookies

Strictly Necessary Cookie allow you to log in and download your software or post to forums.

We use the WordPress login cookie and the session cookie.

If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.

Support Cookies

Foliovision.com uses self-hosted Rocket.chat and self-hosted Freescout support desk to provide support for FV Player users. These cookies allow our visitors to chat with us and/or submit support tickets.

We are delighted to recommend self-hosted Rocket.chat and especially Freescout to other privacy-conscious independent publishers who would prefer to self-host support.

Please enable Strictly Necessary Cookies first so that we can save your preferences!

3rd Party Cookies

This website uses Google Analytics and Statcounter to collect anonymous information such as the number of visitors to the site, and the most popular pages.

Keeping this cookie enabled helps us to improve our website.

We reluctantly use Google Analytics as it helps us to test FV Player against popular Google Analytics features. Feel free to turn off these cookies if they make you feel uncomfortable.

Statcounter is an independent Irish stats service which we have been using since the beginning of recorded time, sixteen years ago.

Please enable Strictly Necessary Cookies first so that we can save your preferences!