capturing 'magick compare' stderr and output filename to csv. Win7/IM7 .

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
Henrryparth
Posts: 1
Joined: 2018-12-28T02:55:31-07:00
Authentication code: 1152

capturing 'magick compare' stderr and output filename to csv. Win7/IM7 .

Post by Henrryparth » 2018-12-28T02:58:25-07:00

Hi I am for looping through a list of input images to compare against a reference image with the AE metric. I get my difference value on stderr. Ultimately I am trying to capture my output filename and the http://movieseriesworld.com/ http://www.movieseriesworld.com/forums/index.php difference value in a csv file to analyze. But i am completely stumped. I can get the stderr piped to a txt file with 2>output.csv, but cannot figure out how to get the output file name alongside the stderr data. Any ideas? maybe there is a magick logging trick?
Last edited by Henrryparth on 2018-12-28T22:45:57-07:00, edited 1 time in total.

snibgo
Posts: 11213
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: capturing 'magick compare' stderr and output filename to csv. Win7/IM7 .

Post by snibgo » 2018-12-28T03:24:28-07:00

If you show us the exact commands you use, and tell us your version number and platform (Windows CMD? Windows BAT?) we can give better advice.

Have you tried "-format"? For example:

Code: Select all

f:\web\im>%IMG7%magick compare -metric RMSE toes.png toes.jpg -format "%f," NULL: >x.txt 2>&1

f:\web\im>type x.txt
toes.png,617.68 (0.00942519)
Or:

Code: Select all

f:\web\im>%IMG7%magick toes.png toes.jpg -metric RMSE -format "%f,%[distortion]"
 -compare info:x2.txt

f:\web\im>type x2.txt
toes.png,0.00942519
snibgo's IM pages: im.snibgo.com

Post Reply