Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Hi all, i'm brand new to imagemagick and immensely appreciate any help offered. I worked up this very inefficient shell script to crop and append right-eye.png in 4 different files.
It works fine for offline use, but i want to implement this script now within PHP and i have a hard time figuring out how to combine all these commands in to one.
There are two common ways to do this more efficiently. Each does so by only reading the input image once and puts all commands into one command line. One method uses clones and parenthesis processing. The other uses in memory mpr: format and parenthesis processing.
the final null: just means throw away any temporary images used in the command line, since all the output image are done by using -write in the parenthesis.
The script will not run under Imagick. Imagick needs separate calls for each step and does not support mpr: or clones. The Imagick syntax is quite different from the command line syntax. It can be done in Imagick, but you can run these bash scripts directly with PHP exec()
I do not use Imagick for the reason fmw42 said above and when php was upgraded to 5.4 something Imagick stopped working. Although I believe it is fixed now and if it is only you using the code it is not so much of a problem. But on a live website it would be a pain.
How do you get your data? If in an array I do a loop and create the command something like:
I am currently working on some code and it took something like 3.7seconds to run as individual commands and went down to 1.5seconds using the example above. This was with 14 crops on a .png 800px x 250px approx.; I forget the actual size now.