Page 2 of 2

Re: Corner squares coord+size detection

Posted: 2012-06-14T17:01:46-07:00
by vitsin
Please correct me if I'm wrong, but for the last method the offset is always +0+0:

# trim
convert negated.png -trim +repage negated_trim.gif

# print first row
convert negated_trim.gif[210x1+0+0] txt:

# ImageMagick pixel enumeration: 210,1,255,gray
0,0: (255,255,255) #FFFFFF gray(255,255,255) --- white
...

# Offset from orignal image
convert negated_trim.gif -format "%O" info:
+0+0


thank you,
--vs

Re: Corner squares coord+size detection

Posted: 2012-06-14T17:51:03-07:00
by fmw42
Use

convert negated.png -format "%@" info:
or
identify -format "%@" negated.png

210x210+45+45


to get the trim offsets and size without having to do a trim without +repage. see http://www.imagemagick.org/script/escape.php

(Or do a second trim, but leave off the +repage and then get the geometry.)


see how I packaged it all compactly at http://studio.imagemagick.org/discourse ... 112#p85956

Re: Corner squares coord+size detection

Posted: 2012-06-15T08:45:57-07:00
by vitsin
hi,
2nd solution with pixel enumeration working great now!!!
Thanks a lot!
--vs