To support simplicity, possibility and cost effective of PHP

Resize images with ImageMagic

Jul 1st, 2008 | By admin | Category: PHP

1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 3.75 out of 5)
Loading ... Loading ...

I used my old Image utilities class for a long time until today taking it seriously for an e-commerce website to resize administrative uploaded images. The library use GD2 PHP module with some calculation to resize images proportionally. Unfortunately, quality is very low for big images, those are more than 1200×1200 px.

Figured out that GD2 is not good in production environment for image processing, I turned to an ImagMagic solution. Very lucky for me I found Asido. This cool library though at its 0.0.0.1 version provides some cool features like watermark, flip, flop, resize and crop. Asido works with image processing library through its drivers. Currently, it support GD, ImageMagic (php_imagick.dll), MagicWand (php_magicwand.dll) and image magic shell.

After half day strugling with Asido, GD driver does not make any improvement. Also calling resize() in a loop get error. MagicWand is expected to be the best solution as it’s the new ImageMagic library. Actually, result images are totally blank. I don’t test ImageMagic shell driver as some host will not allow to install ImageMagic. So the last thing to count on is ImageMagic classic extension.

It didn’t work!!! I was really crazy with this library. Calling resize() always get error imagick_readimage() is undefined function. Another half day pass, the PECL site points out that imagick_xxx() functions are for old version of imagick. The new one use a more OOP way, Imagick::functionxxx().

Pheew, at the end I spend 2 hours rewrite Asido ImageMagic driver for php_imagick.dll 2.x.x and it works like a champ. The result images quality can be compared with Windows Vista Photo Manager resize tool. Love it!!!

Fix Asido 0.0.0.1 ImageMagic deprecated functions

Image magic for PHP 5.2.x on Windows

I ported most of Asido features in ImageMagic driver but not tested as time is not allow. If anyone can make a test and post the bug, it would really help. Asido has bug tracker and support forum but really don’t know how to post something there.

Leave Comment