Page 1 of 1

command line help

Posted: 2019-03-26T19:26:25-07:00
by Ted
Version: ImageMagick 7.0.7-28

I need to compare 2 png files. And a file needs to chop an edge.
convert base.png -gravity EAST -chop 6x0 base.png
compare -metric AE clean.png base.png result.png

I would like to combine into one command line:
compare -metric AE clean.png \( base.png -gravity EAST -chop 6x0 \) result.png

But get error:
compare: unrecognized option `-chop'

I was using -crop and it worked without problem. So I thought changing to -chop should be no problem.

Re: command line help

Posted: 2019-03-26T19:53:08-07:00
by fmw42
compare does not allow such. But you can use convert

Code: Select all

magick clean.png \( base.png -gravity EAST -chop 6x0 \) -metric AE -compare +write result.png -format "%[distortion]" info:
See https://imagemagick.org/script/command- ... hp#compare

Re: command line help

Posted: 2019-03-26T20:42:48-07:00
by fmw42
P.S. You can request that -chop be added to compare in the Developers Forum. But that may or may not get done quickly.

Re: command line help

Posted: 2019-03-26T20:43:47-07:00
by fmw42
Also note that for IM 7, it would be magick compare and not just compare. compare alone is for IM 6.

See https://imagemagick.org/script/porting.php#cli

Re: command line help

Posted: 2019-03-26T20:48:28-07:00
by Ted
Thanks.

This works.

And thanks again.