Get coordinates x,y of a clipping path #1

MagickWand for PHP is an object-oriented PHP interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning MagickWand for PHP.
Post Reply
shuw
Posts: 2
Joined: 2019-05-23T09:40:37-07:00
Authentication code: 1152

Get coordinates x,y of a clipping path #1

Post by shuw » 2019-05-23T09:44:38-07:00

I try to obtain the coordinates of a clipping path in an image.
How is that possible?

User avatar
fmw42
Posts: 25584
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Get coordinates x,y of a clipping path #1

Post by fmw42 » 2019-05-23T09:58:25-07:00

Often it will be listed as SVG text in the

Code: Select all

identify -verbose image.suffix. 


If the image is TIF, it can be extracted from the 8bim file as follows:

Code: Select all

identify -format '%[8BIM:1999,2998:#1]' image_clip.tiff

shuw
Posts: 2
Joined: 2019-05-23T09:40:37-07:00
Authentication code: 1152

Re: Get coordinates x,y of a clipping path #1

Post by shuw » 2019-05-24T06:47:06-07:00

fmw42 wrote:
2019-05-23T09:58:25-07:00
Often it will be listed as SVG text in the

Code: Select all

identify -verbose image.suffix. 


If the image is TIF, it can be extracted from the 8bim file as follows:

Code: Select all

identify -format '%[8BIM:1999,2998:#1]' image_clip.tiff
Thank you, I was aware of that. I tried to get the same result using the PHP Class.
I was able using Imagick::identifyImage (true) and extracted the svg string portion of the appended rawOutput.

Post Reply