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,832 responses to “ImageMagick installing and exploring it, a good alternative for the GD library”

  1. Carroljew Avatar
    Carroljew

    Hello, I just came across the best source from India to save on Rx. For those looking for cheap antibiotics at factory prices, this store is worth checking. You get wholesale rates to USA. Take a look: https://indiapharm.in.net/#. Best regards.

  2. DavidTenty Avatar
    DavidTenty

    Greetings, Lately came across the best Indian pharmacy for affordable pills. If you want to buy medicines from India without prescription, this store is very reliable. They offer lowest prices worldwide. Take a look: https://indiapharm.in.net/#. Cheers.

  3. JamesFUS Avatar
    JamesFUS

    Greetings, I recently ran into a trusted online source to buy medication. For those seeking and need affordable prescriptions, Pharm Mex is the best option. They ship to USA plus very reliable. Check it out: https://pharm.mex.com/#. Peace.

  4. Carroljew Avatar
    Carroljew

    Hey there, I recently came across a trusted website to save on Rx. If you want to save money and need affordable prescriptions, Pharm Mex is the best option. No prescription needed plus it is safe. Check it out: https://pharm.mex.com/#. Thanks!

  5. JamesFUS Avatar
    JamesFUS

    Hey guys, Lately stumbled upon a useful online drugstore for affordable pills. For those looking for ED meds cheaply, this store is the best place. You get secure delivery to USA. Check it out: indian pharmacy online. Cheers.

  6. Carroljew Avatar
    Carroljew

    Hi guys, Lately discovered a trusted online source to buy medication. If you are tired of high prices and need meds from Mexico, Pharm Mex is a game changer. No prescription needed and it is safe. Take a look: https://pharm.mex.com/#. Many thanks.

  7. DavidSab Avatar
    DavidSab

    Gençler, Grandpashabet yeni adresi belli oldu. Giremeyenler buradan giriş yapabilir Grandpashabet Yeni Adres

  8. TimothyKef Avatar
    TimothyKef

    Gençler, Grandpashabet yeni adresi açıklandı. Giremeyenler buradan devam edebilir Grandpashabet Giriş

  9. Georgebig Avatar
    Georgebig

    Grandpasha guncel linki laz?msa iste burada. Sorunsuz erisim icin t?kla Siteye Git Deneme bonusu bu sitede.

  10. Ricardodor Avatar
    Ricardodor

    Matbet guncel linki laz?msa dogru yerdesiniz. Mac izlemek icin: Matbet Uyelik Yuksek oranlar bu sitede. Gencler, Matbet son linki belli oldu.

  11. DavidSab Avatar
    DavidSab

    Dostlar selam, bu site kullanıcıları adına kısa bir bilgilendirme yapmak istiyorum. Malum Vaycasino giriş linkini tekrar değiştirdi. Giriş sorunu yaşıyorsanız panik yapmayın. Çalışan siteye erişim adresi şu an aşağıdadır: https://vaycasino.us.com/# Bu link ile vpn kullanmadan siteye erişebilirsiniz. Lisanslı casino deneyimi sürdürmek için Vay Casino tercih edebilirsiniz. Tüm forum üyelerine bol şans dilerim.

  12. Ricardodor Avatar
    Ricardodor

    Matbet TV giris linki laz?msa iste burada. Mac izlemek icin t?kla: https://matbet.jp.net/# Canl? maclar bu sitede. Gencler, Matbet bahis yeni adresi belli oldu.

  13. TimothyKef Avatar
    TimothyKef

    Matbet giriş adresi lazımsa doğru yerdesiniz. Hızlı için: Siteye Git Yüksek oranlar burada. Gençler, Matbet son linki belli oldu.

  14. DavidSab Avatar
    DavidSab

    Grandpashabet giriş linki lazımsa doğru yerdesiniz. Sorunsuz erişim için tıkla Grandpashabet Yüksek oranlar burada.

  15. Georgebig Avatar
    Georgebig

    Arkadaslar, Grandpashabet Casino son linki ac?kland?. Adresi bulamayanlar buradan giris yapabilir Grandpashabet Indir

  16. Ricardodor Avatar
    Ricardodor

    Grandpasha guncel adresi laz?msa iste burada. Sorunsuz giris yapmak icin https://grandpashabet.in.net/# Deneme bonusu burada.

  17. TimothyKef Avatar
    TimothyKef

    Herkese merhaba, bu popüler site üyeleri için önemli bir bilgilendirme paylaşıyorum. Herkesin bildiği üzere bahis platformu domain adresini erişim kısıtlaması nedeniyle sürekli taşıdı. Erişim problemi varsa link aşağıda. Güncel Casibom güncel giriş adresi artık burada Giriş Yap Bu link üzerinden direkt siteye girebilirsiniz. Ayrıca yeni üyelere sunulan freespin kampanyalarını da kaçırmayın. Lisanslı casino deneyimi sürdürmek için Casibom doğru adres. Herkese bol kazançlar dilerim.

  18. Ricardodor Avatar
    Ricardodor

    Herkese selam, bu populer site kullan?c?lar? ad?na onemli bir duyuru paylas?yorum. Bildiginiz gibi Casibom domain adresini erisim k?s?tlamas? nedeniyle tekrar degistirdi. Erisim problemi varsa link asag?da. Cal?san siteye erisim adresi su an burada Giris Yap Paylast?g?m baglant? uzerinden dogrudan siteye erisebilirsiniz. Ek olarak kay?t olanlara sunulan hosgeldin bonusu f?rsatlar?n? mutlaka inceleyin. En iyi slot deneyimi icin Casibom tercih edebilirsiniz. Herkese bol sans dilerim.

  19. DavidSab Avatar
    DavidSab

    Matbet TV giriş linki arıyorsanız doğru yerdesiniz. Sorunsuz için: https://matbet.jp.net/# Yüksek oranlar bu sitede. Arkadaşlar, Matbet yeni adresi açıklandı.

  20. Georgebig Avatar
    Georgebig

    Matbet guncel linki ar?yorsan?z iste burada. Mac izlemek icin t?kla: https://matbet.jp.net/# Canl? maclar burada. Gencler, Matbet son linki ac?kland?.

  21. TimothyKef Avatar
    TimothyKef

    Arkadaşlar, Grandpashabet Casino son linki açıklandı. Adresi bulamayanlar şu linkten giriş yapabilir Siteye Git

  22. Ricardodor Avatar
    Ricardodor

    Grandpashabet guncel linki laz?msa iste burada. H?zl? erisim icin Grandpashabet Guncel Deneme bonusu bu sitede.

  23. DavidSab Avatar
    DavidSab

    Gençler, Grandpashabet son linki açıklandı. Adresi bulamayanlar buradan giriş yapabilir Siteye Git

  24. Ricardodor Avatar
    Ricardodor

    Dostlar selam, bu site oyuncular? icin onemli bir bilgilendirme yapmak istiyorum. Malum platform giris linkini tekrar guncelledi. Erisim hatas? yas?yorsan?z endise etmeyin. Guncel Vay Casino giris linki su an burada: https://vaycasino.us.com/# Bu link ile vpn kullanmadan hesab?n?za erisebilirsiniz. Lisansl? casino keyfi surdurmek icin Vay Casino tercih edebilirsiniz. Tum forum uyelerine bol sans dilerim.

  25. DavidSab Avatar
    DavidSab

    Arkadaşlar, Grandpashabet son linki açıklandı. Giremeyenler şu linkten giriş yapabilir Grandpashabet İndir

  26. TimothyKef Avatar
    TimothyKef

    Arkadaşlar selam, Casibom sitesi üyeleri için önemli bir bilgilendirme paylaşıyorum. Herkesin bildiği üzere Casibom domain adresini BTK engeli yüzünden tekrar güncelledi. Erişim problemi varsa link aşağıda. Resmi Casibom giriş linki artık aşağıdadır https://casibom.mex.com/# Bu link ile vpn kullanmadan hesabınıza erişebilirsiniz. Ayrıca kayıt olanlara sunulan freespin fırsatlarını da kaçırmayın. En iyi bahis deneyimi için Casibom tercih edebilirsiniz. Herkese bol kazançlar dilerim.

  27. Georgebig Avatar
    Georgebig

    Grandpashabet guncel adresi laz?msa iste burada. Sorunsuz giris yapmak icin https://grandpashabet.in.net/# Yuksek oranlar bu sitede.

  28. Ricardodor Avatar
    Ricardodor

    Matbet giris adresi ar?yorsan?z dogru yerdesiniz. Sorunsuz icin: Matbet Canl? Yuksek oranlar burada. Arkadaslar, Matbet yeni adresi ac?kland?.

  29. DavidSab Avatar
    DavidSab

    Matbet giriş linki arıyorsanız işte burada. Sorunsuz için: Matbet Yeni Adres Canlı maçlar bu sitede. Arkadaşlar, Matbet bahis yeni adresi belli oldu.

  30. TimothyKef Avatar
    TimothyKef

    Arkadaşlar, Grandpashabet Casino son linki belli oldu. Giremeyenler şu linkten giriş yapabilir Giriş Yap

  31. Ricardodor Avatar
    Ricardodor

    Matbet guncel adresi laz?msa iste burada. Sorunsuz icin: Matbet Canl? Yuksek oranlar bu sitede. Arkadaslar, Matbet bahis yeni adresi ac?kland?.

  32. DavidSab Avatar
    DavidSab

    Dostlar selam, Vaycasino oyuncuları adına kısa bir duyuru paylaşıyorum. Malum site adresini yine değiştirdi. Erişim hatası yaşıyorsanız panik yapmayın. Çalışan Vay Casino giriş adresi artık aşağıdadır: Vaycasino Bonus Bu link ile doğrudan siteye erişebilirsiniz. Güvenilir bahis deneyimi sürdürmek için Vay Casino doğru adres. Tüm forum üyelerine bol şans temenni ederim.

  33. Georgebig Avatar
    Georgebig

    Matbet TV giris adresi laz?msa iste burada. H?zl? icin: https://matbet.jp.net/# Yuksek oranlar burada. Arkadaslar, Matbet yeni adresi ac?kland?.

  34. DavidSab Avatar
    DavidSab

    Gençler, Grandpashabet yeni adresi belli oldu. Giremeyenler buradan giriş yapabilir Grandpashabet Güncel

  35. www.binance.info registrera dig 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?

  36. Ricardodor Avatar
    Ricardodor

    Herkese selam, Vay Casino oyuncular? icin k?sa bir duyuru paylas?yorum. Malum site adresini yine guncelledi. Giris hatas? yas?yorsan?z panik yapmay?n. Guncel Vaycasino giris linki su an asag?dad?r: https://vaycasino.us.com/# Bu link ile dogrudan siteye girebilirsiniz. Guvenilir bahis keyfi icin Vay Casino dogru adres. Tum forum uyelerine bol sans temenni ederim.

  37. TimothyKef Avatar
    TimothyKef

    Arkadaşlar, Grandpashabet yeni adresi açıklandı. Giremeyenler şu linkten giriş yapabilir Resmi Site

  38. DavidSab Avatar
    DavidSab

    Arkadaşlar selam, Casibom oyuncuları adına önemli bir paylaşım yapmak istiyorum. Herkesin bildiği üzere site adresini BTK engeli yüzünden tekrar değiştirdi. Erişim sorunu yaşıyorsanız çözüm burada. Yeni siteye erişim bağlantısı şu an paylaşıyorum https://casibom.mex.com/# Paylaştığım bağlantı üzerinden direkt siteye bağlanabilirsiniz. Ayrıca yeni üyelere verilen yatırım bonusu fırsatlarını mutlaka inceleyin. Güvenilir casino deneyimi sürdürmek için Casibom tercih edebilirsiniz. Tüm forum üyelerine bol kazançlar dilerim.

  39. Ricardodor Avatar
    Ricardodor

    Grandpashabet guncel adresi ar?yorsan?z dogru yerdesiniz. H?zl? erisim icin Grandpashabet Kay?t Yuksek oranlar burada.

  40. DavidSab Avatar
    DavidSab

    Matbet giriş linki lazımsa doğru yerdesiniz. Hızlı için: https://matbet.jp.net/# Canlı maçlar bu sitede. Gençler, Matbet yeni adresi belli oldu.

  41. Ricardodor Avatar
    Ricardodor

    Arkadaslar, Grandpashabet Casino yeni adresi ac?kland?. Adresi bulamayanlar su linkten devam edebilir Grandpashabet Mobil

  42. TimothyKef Avatar
    TimothyKef

    Arkadaşlar, Grandpashabet yeni adresi açıklandı. Adresi bulamayanlar buradan giriş yapabilir Siteye Git

  43. Georgebig Avatar
    Georgebig

    Bahis severler selam, Casibom sitesi oyuncular? icin onemli bir bilgilendirme yapmak istiyorum. Herkesin bildigi uzere bahis platformu domain adresini BTK engeli yuzunden tekrar degistirdi. Erisim hatas? varsa dogru yerdesiniz. Son Casibom giris baglant?s? su an asag?dad?r Casibom Yeni Adres Paylast?g?m baglant? uzerinden dogrudan hesab?n?za girebilirsiniz. Ek olarak kay?t olanlara sunulan hosgeldin bonusu f?rsatlar?n? mutlaka kac?rmay?n. Guvenilir slot keyfi icin Casibom dogru adres. Herkese bol sans dilerim.

  44. DavidSab Avatar
    DavidSab

    Herkese merhaba, bu popüler site kullanıcıları için kısa bir duyuru yapmak istiyorum. Herkesin bildiği üzere bahis platformu domain adresini BTK engeli yüzünden tekrar değiştirdi. Siteye ulaşım hatası çekenler için çözüm burada. Çalışan Casibom güncel giriş bağlantısı artık aşağıdadır Resmi Site Bu link ile direkt hesabınıza erişebilirsiniz. Ayrıca kayıt olanlara sunulan hoşgeldin bonusu fırsatlarını da kaçırmayın. Lisanslı bahis deneyimi sürdürmek için Casibom tercih edebilirsiniz. Herkese bol kazançlar dilerim.

  45. Ricardodor Avatar
    Ricardodor

    Gencler, Grandpashabet yeni adresi belli oldu. Giremeyenler su linkten giris yapabilir Grandpashabet Sorunsuz Giris

  46. TimothyKef Avatar
    TimothyKef

    Arkadaşlar selam, Casibom üyeleri için önemli bir paylaşım paylaşıyorum. Herkesin bildiği üzere site domain adresini erişim kısıtlaması nedeniyle yine taşıdı. Giriş hatası varsa doğru yerdesiniz. Resmi Casibom güncel giriş bağlantısı şu an burada https://casibom.mex.com/# Bu link ile vpn kullanmadan hesabınıza girebilirsiniz. Ek olarak kayıt olanlara verilen freespin fırsatlarını da inceleyin. Lisanslı slot keyfi sürdürmek için Casibom doğru adres. Herkese bol şans dilerim.

  47. Рестраця 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? https://accounts.binance.info/register-person?ref=IHJUI7TF

Leave a Reply

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