ImageMagick installing and exploring it, a good alternative for the GD library

Although PHP GD library handles basic image operations quite good, you have probably run into the limitations of GD library as well, it is often slow, memory intensive and a bit complicated to use for advanced image effects. ImageMagick however is a very good alternative. It is an opensource software suite licensed under a BSD style license from IM itself. ImageMagick provides in all functionality that can be accomplished with the GD library but even goes a step further with support for more advanced image edit techniques. An example of such a technique is the recently added “liquid scaling” feature, this is a content aware scaling option.

Click the image below to see an example of liquid scaling:
Liquid Scaling with imagemagick

So how do I get such a result? Well with PHP GD library it would take a whole lot of code, thinking and beers to get a script that does the same without exceeding your memory_limit, with ImageMagick however it is just one simple command.

exec("convert inputimage.jpg  -liquid-rescale 250x500%\!  outputimage.jpg");

The nice thing about ImageMagick is that you can often accomplish very sophisticated image effects with just one command, you can also chain commands. Now although IM has a quite good documentation guide available you maybe just want to be able to perform basic image operations with IM without seeking your way trough the documentation all the time. Their are some PHP classes available that will make your life easier.

My personal favor is PhMagick or a home brew script, why? Well I like the idea of wrapper classes more, my code is somewhat more portable because I don’t have to install the IM extension on a server and another PHP extension to communicate with it, furthermore I think that using wrapper classes gives you more insight in IM itself, you will better understand what is going on, on the other hand you probably will spend some hours to figure out why the command is not doing what you expected it to do because you are missing a simple ! or ^ parameter option.

Personal experience on installing IM on the server
Some time ago I wanted to install IM on my new dev and live server, the dev server is running OSX and the live server is running a Fedora distribution. So the first step before I tried to install IM was to read the documentation (yeah I’m one of those guys that also actually reads the readme files and documentation 😉 of products). I followed the “Install from source” tutorial. So I started with the live server, after downloading and unpacking IM I ran the ./configure command immediately I was faced with the error “no acceptable c compiler found in $PATH”, now my Linux skills are far from topnotch, so after some googling I found out that the easiest way to fix this issue was to install GCC (GNU Compiler Collection) that already included a C compiler. After installing GCC and running the ./configure command everything went fine, IM was installed successfully. I wanted to test if it was working correctly so I tried to resize several images but again an error occurred “convert: no decode delegate for this image format”, okay perhaps I should read the documentation more carefully next time because before installing IM you should also install the image libraries that you will use. In my case this was “yum install libjpeg libjpeg-devel libpng libpng-devel libtiff libtiff-devel”, now again I needed to install IM again, not much work, but still something to remember when installing IM. On the dev OSX server installing ImageMagick was quite simple, I used a precompiled dmg and only needed to install the Apple XCode developer tools.

So to summarize:

Advantages of using ImageMagick:

  • it uses less resources, forget about the memory_limit issues with PHP when using GD and large images
  • it’s slighty faster (note: depending on the filetype and image size GD beats IM in speed when it comes to resizing
  • Image Magick has support for more filetypes
  • as I showed before, it is very simple to use
    exec('convert "'.$sSourcePath.'" -resize '.$iWidth.'x"'.$sDestinationPath.'"');
  • Some very nice features like liquid scaling or seam carving

Disadvantages of using Image Magick:

  • you need to have full access to your server, it isn’t bundled with PHP
  • compiling IM can give some trouble, you shouldn’t forget to get the image libraries you want to use

Useful links

Comments

1,834 responses to “ImageMagick installing and exploring it, a good alternative for the GD library”

  1. Richardobepe Avatar
    Richardobepe

    п»їTo be honest, I discovered a useful page about generic pills availability. It covers how to save money on prescriptions. For those interested in reliable shipping to USA, read this: п»їsource. Might be useful.

  2. Ralphter Avatar
    Ralphter

    п»їActually, I came across a useful page concerning cheap Indian generics. It covers CDSCO regulations for generic meds. If you are looking for factory prices, visit this link: п»їreputable indian pharmacies. Good info.

  3. DanielTus Avatar
    DanielTus

    п»їRecently, I stumbled upon an interesting article concerning Indian Pharmacy exports. It explains how to save money for generic meds. In case you need cheaper alternatives, go here: п»їhttps://kisawyer.us.com/# Online medicine order. Might be useful.

  4. Richardobepe Avatar
    Richardobepe

    Heads up, a helpful guide on Mexican Pharmacy safety. It breaks down the best shipping methods for antibiotics. Full info: п»їUpstate Medical.

  5. Lloydpenda Avatar
    Lloydpenda

    п»їActually, I discovered a useful resource concerning generic pills availability. It details regulations for ED medication. If anyone wants affordable options, take a look: п»їhttps://polkcity.us.com/# pharmacy in mexico city. It helped me.

  6. Ralphter Avatar
    Ralphter

    п»їJust now, I came across a useful report about buying affordable antibiotics. It details CDSCO regulations for ED medication. If you are looking for reliable shipping to USA, check this out: п»їhttps://kisawyer.us.com/# cheapest online pharmacy india. Worth a read.

  7. DanielTus Avatar
    DanielTus

    п»їActually, I found a great report regarding ordering meds from India. It details WHO-GMP protocols for ED medication. In case you need factory prices, read this: п»їhttps://kisawyer.us.com/# indian pharmacy online. Cheers.

  8. Richardobepe Avatar
    Richardobepe

    FYI, an official analysis on FDA equivalent standards. It breaks down how to avoid scams for antibiotics. Link: п»їhttps://polkcity.us.com/# mexico pharmacy list.

  9. Ralphter Avatar
    Ralphter

    п»їTo be honest, I discovered a helpful resource concerning cheap Indian generics. It covers how to save money on prescriptions. If you are looking for factory prices, go here: п»їcheck it out. Hope it helps.

  10. DanielTus Avatar
    DanielTus

    п»їJust now, I came across a useful page concerning Indian Pharmacy exports. The site discusses the manufacturing standards for ED medication. If anyone wants Trusted Indian sources, take a look: п»їkisawyer.us.com. Worth a read.

  11. Richardobepe Avatar
    Richardobepe

    п»їActually, I discovered a useful guide regarding buying affordable antibiotics. It covers FDA equivalents on prescriptions. If anyone wants Trusted pharmacy sources, read this: п»їhttps://polkcity.us.com/# mexico drug store online. Might be useful.

  12. Lloydpenda Avatar
    Lloydpenda

    For those looking to save big on pills, you should try checking this page. It reveals shipping costs. Discounted options available here: п»їhttps://polkcity.us.com/# purple pharmacy mexico.

  13. Ralphter Avatar
    Ralphter

    п»їRecently, I stumbled upon a useful article concerning Indian Pharmacy exports. It covers WHO-GMP protocols for ED medication. If anyone wants reliable shipping to USA, read this: п»їhttps://kisawyer.us.com/# reputable indian online pharmacy. It helped me.

  14. DanielTus Avatar
    DanielTus

    п»їRecently, I came across a useful article about cheap Indian generics. It explains the manufacturing standards for generic meds. For those interested in cheaper alternatives, go here: п»їhttps://kisawyer.us.com/# mail order pharmacy india. Good info.

  15. Richardobepe Avatar
    Richardobepe

    п»їRecently, I came across an interesting guide concerning safe pharmacy shipping. It details the safety protocols when buying antibiotics. In case you need affordable options, check this out: п»їpolkcity.us.com. Good info.

  16. Ralphter Avatar
    Ralphter

    п»їTo be honest, I stumbled upon a useful article concerning cheap Indian generics. It explains the manufacturing standards when buying antibiotics. For those interested in reliable shipping to USA, visit this link: п»їhttps://kisawyer.us.com/# world pharmacy india. It helped me.

  17. DanielTus Avatar
    DanielTus

    п»їLately, I discovered a great report about ordering meds from India. It explains how to save money for generic meds. For those interested in reliable shipping to USA, take a look: п»їinformation. Cheers.

  18. Richardobepe Avatar
    Richardobepe

    п»їActually, I discovered an informative guide concerning Mexican Pharmacy standards. It details regulations for ED medication. In case you need Trusted pharmacy sources, check this out: п»їpharmacies in mexico. Hope it helps.

  19. Ralphter Avatar
    Ralphter

    п»їRecently, I came across an informative article regarding ordering meds from India. It details how to save money when buying antibiotics. If anyone wants factory prices, go here: п»їhttps://kisawyer.us.com/# top 10 online pharmacy in india. Might be useful.

  20. DanielTus Avatar
    DanielTus

    п»їTo be honest, I discovered a helpful report about cheap Indian generics. The site discusses the manufacturing standards for generic meds. If anyone wants Trusted Indian sources, visit this link: п»їreputable indian pharmacies. Good info.

  21. Richardobepe Avatar
    Richardobepe

    Does anyone know safe Mexican pharmacies. I saw a good site that ranks best pharmacies: п»їhttps://polkcity.us.com/# mexican pharmacy ship to usa. What do you think?.

  22. Lloydpenda Avatar
    Lloydpenda

    Sharing, an important analysis on buying meds safely. It explains how to avoid scams for generics. Full info: п»їhttps://polkcity.us.com/# mexican pharmacies near me.

  23. Ralphter Avatar
    Ralphter

    п»їJust now, I stumbled upon a helpful page concerning Indian Pharmacy exports. It details WHO-GMP protocols when buying antibiotics. If you are looking for factory prices, go here: п»їonline pharmacy india. Hope it helps.

  24. DanielTus Avatar
    DanielTus

    п»їLately, I stumbled upon an interesting guide concerning cheap Indian generics. It explains how to save money on prescriptions. In case you need factory prices, check this out: п»їnavigate here. Hope it helps.

  25. Richardobepe Avatar
    Richardobepe

    FYI, an official article on cross-border shipping rules. The author describes quality control for antibiotics. Full info: п»їhttps://polkcity.us.com/# pharmacy mexico.

  26. Ralphter Avatar
    Ralphter

    п»їActually, I found a helpful article regarding cheap Indian generics. The site discusses WHO-GMP protocols when buying antibiotics. If you are looking for cheaper alternatives, visit this link: п»їindian pharmacy. It helped me.

  27. DanielTus Avatar
    DanielTus

    п»їActually, I found a helpful resource about generic pills from India. It covers CDSCO regulations when buying antibiotics. For those interested in cheaper alternatives, go here: п»їreputable indian online pharmacy. Might be useful.

  28. Richardobepe Avatar
    Richardobepe

    FYI, a detailed analysis on buying meds safely. It breaks down how to avoid scams for antibiotics. Full info: п»їUpstate Medical.

  29. Ralphter Avatar
    Ralphter

    п»їLately, I discovered a helpful article concerning Indian Pharmacy exports. It details CDSCO regulations for ED medication. In case you need cheaper alternatives, check this out: п»їonline pharmacy india. Might be useful.

  30. Lloydpenda Avatar
    Lloydpenda

    п»їLately, I found an informative report concerning buying affordable antibiotics. The site discusses regulations for generic meds. In case you need affordable options, take a look: п»їhttps://polkcity.us.com/# mexico city pharmacy. Cheers.

  31. DanielTus Avatar
    DanielTus

    п»їActually, I stumbled upon a helpful page concerning buying affordable antibiotics. The site discusses WHO-GMP protocols for generic meds. In case you need factory prices, visit this link: п»їhere. It helped me.

  32. Richardobepe Avatar
    Richardobepe

    For those looking to save big on pills, you should try visiting this resource. It reveals prices for generics. Discounted options found here: п»їpolkcity.us.com.

  33. Ralphter Avatar
    Ralphter

    п»їTo be honest, I discovered an interesting guide concerning generic pills from India. It explains WHO-GMP protocols for generic meds. If anyone wants reliable shipping to USA, take a look: п»їcheck it out. Cheers.

  34. DanielTus Avatar
    DanielTus

    п»їActually, I found a helpful article about Indian Pharmacy exports. It explains WHO-GMP protocols on prescriptions. If you are looking for Trusted Indian sources, visit this link: п»їlink. Worth a read.

  35. Richardobepe Avatar
    Richardobepe

    To save on pharmacy costs, you should try reading this archive. It shows trusted Mexican pharmacies. Discounted options found here: п»їinformation.

  36. Ralphter Avatar
    Ralphter

    п»їRecently, I discovered an informative report concerning cheap Indian generics. It explains CDSCO regulations on prescriptions. In case you need Trusted Indian sources, check this out: п»їvisit. Worth a read.

  37. DanielTus Avatar
    DanielTus

    п»їLately, I stumbled upon an informative resource concerning ordering meds from India. It explains the manufacturing standards on prescriptions. For those interested in reliable shipping to USA, read this: п»їwebsite. Hope it helps.

  38. Richardobepe Avatar
    Richardobepe

    п»їActually, I found a helpful article about safe pharmacy shipping. The site discusses the safety protocols when buying antibiotics. If anyone wants cheaper alternatives, check this out: п»їonline pharmacies in mexico. Good info.

  39. Lloydpenda Avatar
    Lloydpenda

    For those looking to save big on pills, I suggest visiting this page. It reveals where to buy cheap. Good deals found here: п»їhttps://polkcity.us.com/# pharmacy mexico.

  40. Ralphter Avatar
    Ralphter

    п»їTo be honest, I stumbled upon an informative report about cheap Indian generics. It explains CDSCO regulations on prescriptions. If you are looking for reliable shipping to USA, check this out: п»їinformation. Good info.

  41. DanielTus Avatar
    DanielTus

    п»їActually, I stumbled upon a great article regarding cheap Indian generics. The site discusses the manufacturing standards on prescriptions. In case you need reliable shipping to USA, read this: п»їkisawyer.us.com. Cheers.

  42. Richardobepe Avatar
    Richardobepe

    FYI, a detailed overview on FDA equivalent standards. The author describes the best shipping methods for generics. You can read it here: п»їUpstate Medical.

  43. Ralphter Avatar
    Ralphter

    п»їActually, I discovered a great page about generic pills from India. It covers CDSCO regulations on prescriptions. If anyone wants cheaper alternatives, read this: п»їhttps://kisawyer.us.com/# indian pharmacy paypal. Worth a read.

  44. DanielTus Avatar
    DanielTus

    п»їActually, I came across an interesting guide concerning buying affordable antibiotics. The site discusses CDSCO regulations for ED medication. If anyone wants factory prices, go here: п»їhttps://kisawyer.us.com/# mail order pharmacy india. Might be useful.

  45. Richardobepe Avatar
    Richardobepe

    Has anybody tried ordering meds from Mexico. I discovered a good site that compares best pharmacies: п»їpolkcity.us.com. Any thoughts?.

  46. Lloydpenda Avatar
    Lloydpenda

    FYI, an official analysis on FDA equivalent standards. It explains how to avoid scams for ED meds. Link: п»їthis link.

  47. Ralphter Avatar
    Ralphter

    п»їActually, I discovered a useful page regarding cheap Indian generics. It details how to save money on prescriptions. If anyone wants factory prices, visit this link: п»їhttps://kisawyer.us.com/# reputable indian online pharmacy. Worth a read.

  48. DanielTus Avatar
    DanielTus

    п»їRecently, I found a helpful guide about buying affordable antibiotics. It explains the manufacturing standards when buying antibiotics. If you are looking for factory prices, read this: п»їkisawyer.us.com. Cheers.

  49. Richardobepe Avatar
    Richardobepe

    Sharing, an official guide on Mexican Pharmacy safety. The author describes the best shipping methods for ED meds. You can read it here: п»їhttps://polkcity.us.com/# online pharmacy in mexico.

  50. Ralphter Avatar
    Ralphter

    п»їRecently, I discovered an informative guide regarding ordering meds from India. It details the manufacturing standards for ED medication. If you are looking for Trusted Indian sources, go here: п»їhttps://kisawyer.us.com/# world pharmacy india. Worth a read.

Leave a Reply

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