Hi magick,
the documentation says (http://www.imagemagick.org/script/comma ... php#metric) that the option -metric AE outputs to STDERR. I wonder, why it does not output to STDOUT. Well, of course it's the error count of the number of different pixels, but it makes it difficult to only read the number of different pixel and not other error information.
Is there any way to change the output to STDOUT (only for this option) or to output the information in a structered way in order to ignore other error outputs?
Kind regards,
Sven
Option -metric outputs to STDERR
Re: Option -metric outputs to STDERR
We send the metric to stderr because the user may want to send the difference image to stdout. Something like this:
- compare -metric pae reference.png image.png png:- | identify -verbose -
Re: Option -metric outputs to STDERR
There is at least 10 different places in ImageMagick that writes text info to stderr and any image to stdout. Its been this way for quite sometime (other than the occasional bug) and we intend on keeping it that way. If we change it now it would most likely break a lot of existing scripts and bring ire from numerous users.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Option -metric outputs to STDERR
Typically what you would do is junk the image output and then redirect stderr to either stdout or a file using your command line shell.
For exampleor
The 2> and 2>&1 are NOT Imagemagick syntax, but Bourne or BASH shell syntax, if you are on a UNIX-like environment.
see the still rough notes in IM Examples Compare
http://imagemagick.org/Usage/compare/#compare
For example
Code: Select all
convert -metric AE image1 image2 null: 2>metric.txt
Code: Select all
result=`convert -metric AE image1 image2 null: 2>&1`
see the still rough notes in IM Examples Compare
http://imagemagick.org/Usage/compare/#compare
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/