command line help

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Ted
Posts: 2
Joined: 2019-03-26T17:19:26-07:00
Authentication code: 1152

command line help

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: command line help

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: command line help

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: command line help

Post 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
Ted
Posts: 2
Joined: 2019-03-26T17:19:26-07:00
Authentication code: 1152

Re: command line help

Post by Ted »

Thanks.

This works.

And thanks again.
Post Reply