Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#18 Match Imagemagick: -trim -identify returns offset x,y

open
nobody
5
2011-04-05
2011-04-05
Anonymous
No

I could not find where GM provides any way to return the offset coordinates from a trim operation. Imagemagick exposes this data through a -identify operator that can be included with a -trim operator, causing the new trimmed file to be created and the command line to return a string like:

input.png PNG 2162x2162=>1718x1216 2162x2162+222+233 8-bit DirectClass 0.160u 0:00.029

Where +222+233 is the x/y coordinates of the input image where the trim operation found non-background color pixels.

Thank you!
Gregg

Discussion