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. DanielTus Avatar
    DanielTus

    п»їTo be honest, I found an informative resource concerning generic pills from India. It details WHO-GMP protocols for ED medication. In case you need factory prices, take a look: п»їhttps://kisawyer.us.com/# cheapest online pharmacy india. Might be useful.

  2. Lloydpenda Avatar
    Lloydpenda

    Has anybody tried safe Mexican pharmacies. I discovered a verified archive that reviews trusted vendors: п»їpolkcity.us.com. Check it out.

  3. Ralphter Avatar
    Ralphter

    п»їRecently, I came across an informative resource regarding generic pills from India. It explains the manufacturing standards when buying antibiotics. For those interested in reliable shipping to USA, visit this link: п»їkisawyer.us.com. Good info.

  4. DanielTus Avatar
    DanielTus

    п»їRecently, I found a useful article concerning Indian Pharmacy exports. The site discusses WHO-GMP protocols for ED medication. If anyone wants cheaper alternatives, go here: п»їkisawyer.us.com. Hope it helps.

  5. Richardobepe Avatar
    Richardobepe

    п»їJust now, I came across a useful guide regarding Mexican Pharmacy standards. It explains regulations for generic meds. If you are looking for affordable options, take a look: п»їhttps://polkcity.us.com/# mexico pharmacy online. Might be useful.

  6. Ralphter Avatar
    Ralphter

    п»їTo be honest, I found an informative guide about cheap Indian generics. It covers WHO-GMP protocols on prescriptions. In case you need factory prices, check this out: п»їhttps://kisawyer.us.com/# indian pharmacies safe. It helped me.

  7. DanielTus Avatar
    DanielTus

    п»їLately, I discovered a useful report about cheap Indian generics. The site discusses how to save money for ED medication. For those interested in reliable shipping to USA, visit this link: п»їreputable indian online pharmacy. Might be useful.

  8. Richardobepe Avatar
    Richardobepe

    Does anyone know safe Mexican pharmacies. I ran into a verified archive that lists best pharmacies: п»їhttps://polkcity.us.com/# can i order online from a mexican pharmacy. What do you think?.

  9. Ralphter Avatar
    Ralphter

    п»їJust now, I found a helpful page about ordering meds from India. It explains WHO-GMP protocols when buying antibiotics. In case you need Trusted Indian sources, visit this link: п»їindian pharmacy. Worth a read.

  10. DanielTus Avatar
    DanielTus

    п»їJust now, I discovered a helpful guide concerning generic pills from India. It details WHO-GMP protocols when buying antibiotics. If anyone wants Trusted Indian sources, take a look: п»їbuy medicines online in india. Hope it helps.

  11. Lloydpenda Avatar
    Lloydpenda

    Just wanted to share, an official guide on buying meds safely. It breaks down the best shipping methods for generics. Link: п»їpolkcity.us.com.

  12. Richardobepe Avatar
    Richardobepe

    п»їActually, I found an interesting article about generic pills availability. It covers how to save money on prescriptions. For those interested in reliable shipping to USA, take a look: п»їthis site. Worth a read.

  13. Ralphter Avatar
    Ralphter

    п»їTo be honest, I stumbled upon an informative guide regarding buying affordable antibiotics. It details the manufacturing standards when buying antibiotics. If anyone wants reliable shipping to USA, check this out: п»їkisawyer.us.com. It helped me.

  14. DanielTus Avatar
    DanielTus

    п»їLately, I discovered a useful article concerning ordering meds from India. It details WHO-GMP protocols for generic meds. If anyone wants reliable shipping to USA, read this: п»їuseful link. Might be useful.

  15. koreapsychiatry.com Avatar

    online real casino paypal

    References:
    koreapsychiatry.com

  16. Richardobepe Avatar
    Richardobepe

    Sharing, a helpful guide on buying meds safely. It breaks down pricing differences for antibiotics. Full info: п»їhttps://polkcity.us.com/# worldwide pharmacy.

  17. Ralphter Avatar
    Ralphter

    п»їLately, I found a useful report regarding ordering meds from India. The site discusses CDSCO regulations on prescriptions. In case you need factory prices, read this: п»їkisawyer.us.com. Good info.

  18. DanielTus Avatar
    DanielTus

    п»їActually, I found an informative report regarding generic pills from India. It details the manufacturing standards for generic meds. For those interested in reliable shipping to USA, take a look: п»їwebsite. Good info.

  19. Lloydpenda Avatar
    Lloydpenda

    п»їTo be honest, I discovered an interesting report concerning buying affordable antibiotics. It explains regulations when buying antibiotics. In case you need reliable shipping to USA, read this: п»їhttps://polkcity.us.com/# mexico pet pharmacy. Might be useful.

  20. Richardobepe Avatar
    Richardobepe

    I was wondering about buying generic pills online. I saw a decent archive that compares trusted vendors: п»їread more. Any thoughts?.

  21. Ralphter Avatar
    Ralphter

    п»їActually, I found a useful guide regarding cheap Indian generics. It covers CDSCO regulations when buying antibiotics. For those interested in reliable shipping to USA, check this out: п»їindian pharmacy online. Hope it helps.

  22. DanielTus Avatar
    DanielTus

    п»їLately, I found an informative resource regarding cheap Indian generics. It details CDSCO regulations for generic meds. If you are looking for factory prices, check this out: п»їindia online pharmacy. Worth a read.

  23. Richardobepe Avatar
    Richardobepe

    Quick question about getting antibiotics without prescription. I ran into a good site that compares best pharmacies: п»їpolkcity.us.com. Seems useful..

  24. Ralphter Avatar
    Ralphter

    п»їActually, I found a helpful page concerning generic pills from India. The site discusses the manufacturing standards when buying antibiotics. If you are looking for cheaper alternatives, visit this link: п»їkisawyer.us.com. Worth a read.

  25. DanielTus Avatar
    DanielTus

    п»їActually, I stumbled upon a great report about buying affordable antibiotics. The site discusses how to save money for generic meds. In case you need Trusted Indian sources, check this out: п»їnavigate here. Cheers.

  26. Richardobepe Avatar
    Richardobepe

    To save cash on meds, I recommend visiting this report. The site explains where to buy cheap. Huge savings available here: п»їmexican pharmacy online.

  27. Lloydpenda Avatar
    Lloydpenda

    п»їRecently, I found a helpful article regarding Mexican Pharmacy standards. It details FDA equivalents on prescriptions. If you are looking for reliable shipping to USA, visit this link: п»їpolkcity.us.com. Good info.

  28. Ralphter Avatar
    Ralphter

    п»їRecently, I found a great report about generic pills from India. The site discusses CDSCO regulations when buying antibiotics. If anyone wants cheaper alternatives, read this: п»їnavigate here. It helped me.

  29. DanielTus Avatar
    DanielTus

    п»їRecently, I discovered a great page regarding buying affordable antibiotics. It covers WHO-GMP protocols on prescriptions. If anyone wants factory prices, visit this link: п»їhttps://kisawyer.us.com/# india pharmacy. Worth a read.

  30. Richardobepe Avatar
    Richardobepe

    п»їLately, I came across an informative report concerning buying affordable antibiotics. It covers regulations for generic meds. In case you need cheaper alternatives, take a look: п»їhttps://polkcity.us.com/# mexico city pharmacy. It helped me.

  31. Ralphter Avatar
    Ralphter

    п»їRecently, I came across a helpful guide regarding generic pills from India. It covers WHO-GMP protocols for generic meds. If anyone wants reliable shipping to USA, take a look: п»їmore info. Hope it helps.

  32. DanielTus Avatar
    DanielTus

    п»їLately, I found a useful guide regarding cheap Indian generics. The site discusses the manufacturing standards for generic meds. For those interested in Trusted Indian sources, visit this link: п»їreading. Worth a read.

  33. Richardobepe Avatar
    Richardobepe

    Stop overpaying and save on pharmacy costs, I suggest checking this resource. The site explains where to buy cheap. Best prices available here: п»їUpstate Medical.

  34. Ralphter Avatar
    Ralphter

    п»їJust now, I stumbled upon an informative guide regarding Indian Pharmacy exports. It covers WHO-GMP protocols on prescriptions. For those interested in reliable shipping to USA, read this: п»їhttps://kisawyer.us.com/# indianpharmacy com. Good info.

  35. DanielTus Avatar
    DanielTus

    п»їActually, I stumbled upon an informative guide concerning generic pills from India. The site discusses WHO-GMP protocols for generic meds. If you are looking for cheaper alternatives, visit this link: п»їkisawyer.us.com. Might be useful.

  36. Lloydpenda Avatar
    Lloydpenda

    FYI, an important overview on FDA equivalent standards. The author describes how to avoid scams for ED meds. You can read it here: п»їinformation.

  37. Binance美国注册 Avatar

    Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?

  38. Richardobepe Avatar
    Richardobepe

    I was wondering about buying generic pills online. I discovered a verified post that reviews affordable options: п»їUpstate Medical. What do you think?.

  39. Ralphter Avatar
    Ralphter

    п»їRecently, I came across a helpful report regarding Indian Pharmacy exports. It details the manufacturing standards on prescriptions. If you are looking for factory prices, visit this link: п»їhttps://kisawyer.us.com/# buy prescription drugs from india. Good info.

  40. DanielTus Avatar
    DanielTus

    п»їJust now, I discovered an interesting article about generic pills from India. It covers the manufacturing standards on prescriptions. For those interested in Trusted Indian sources, read this: п»їpharmacy website india. Hope it helps.

  41. Ralphter Avatar
    Ralphter

    п»їRecently, I stumbled upon an interesting article about generic pills from India. It details the manufacturing standards when buying antibiotics. For those interested in reliable shipping to USA, visit this link: п»їhttps://kisawyer.us.com/# online shopping pharmacy india. Good info.

  42. Richardobepe Avatar
    Richardobepe

    п»їTo be honest, I came across a great guide concerning ordering meds from Mexico. It covers regulations for ED medication. If you are looking for cheaper alternatives, go here: п»їUpstate Medical. Worth a read.

  43. DanielTus Avatar
    DanielTus

    п»їJust now, I found an interesting resource concerning ordering meds from India. It covers how to save money when buying antibiotics. If you are looking for cheaper alternatives, check this out: п»їindian pharmacy online. Cheers.

  44. Lloydpenda Avatar
    Lloydpenda

    п»їJust now, I came across a useful guide concerning safe pharmacy shipping. It covers how to save money when buying antibiotics. In case you need cheaper alternatives, check this out: п»їpolkcity.us.com. Cheers.

  45. Ralphter Avatar
    Ralphter

    п»їActually, I found a helpful report regarding buying affordable antibiotics. It explains the manufacturing standards for generic meds. If you are looking for factory prices, visit this link: п»їindian pharmacies safe. Worth a read.

  46. DanielTus Avatar
    DanielTus

    п»їLately, I stumbled upon a useful article about Indian Pharmacy exports. It covers WHO-GMP protocols on prescriptions. If you are looking for factory prices, take a look: п»їworld pharmacy india. Good info.

  47. Richardobepe Avatar
    Richardobepe

    п»їTo be honest, I discovered a useful page about ordering meds from Mexico. It explains regulations for ED medication. If anyone wants affordable options, check this out: п»їvisit. Cheers.

  48. Ralphter Avatar
    Ralphter

    п»їActually, I found an informative article regarding Indian Pharmacy exports. It explains CDSCO regulations for ED medication. In case you need reliable shipping to USA, check this out: п»їkisawyer.us.com. Worth a read.

  49. DanielTus Avatar
    DanielTus

    п»їTo be honest, I discovered a great page about generic pills from India. It details WHO-GMP protocols when buying antibiotics. If you are looking for factory prices, visit this link: п»їofficial site. Worth a read.

Leave a Reply

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