Question

I'd like to use imagemagick to make a montage from existing photos on my server. I am having a terrible time getting any code to work properly. I've tried using the few examples I've found by searching, but it's not working.

http://us1.php.net/imagick outlines the library beautifully, but there are no montage examples. I'd just need a proper example to get me off on the right foot and I' can usually take it from there.

Does anyone know of a good resource to learn imagick for PHP?

Was it helpful?

Solution

Here is a working example of montageImage. The example does a color analysis of a photo. To make sure it works properly, you will need to make sure:

  1. You have a valid "test.png".

  2. Imagick::clone has been deprecated as of imagick 3.1.0 in favour of using the clone keyword. So if you have imagick 3.1.0, you will need to change lines 13 and 17.

    $bright = $average->clone();

to

$bright = clone $average;

and

$dark = $average->clone();

to

$dark = clone $average;

Good luck.

OTHER TIPS

Did you start with the basic example?

http://us1.php.net/manual/en/imagick.examples-1.php
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top