I want to use php5 and and the image processing library, imagemagick to locate the center of an image. I have imagemagick, and the php library installed, but i am just starting out, and stumbling through the examples. I haven't found anything that screams hey, this is how to do it! To the same effect, I would like to know how to find the length, of the X & Y dimensions of an image, using imagemagick, because then, I would be able to calculate the center location. Can someone help me with this?
Asked
Active
Viewed 984 times
1 Answers
1
Here is your naswer:
$image = new Imagick("picture.jpg");
$width = $image->getImageWidth();
$height = $image->getImageHeight();
$center_width = $width / 2;
$center_height = $height / 2;
And now you have the coordinates of the center of the image! Tell me if you need further help.

songyuanyao
- 169,198
- 16
- 310
- 405

Cowwando
- 450
- 5
- 11