How to extract the compare parametr (1.#inf) for further use

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
antananarivu
Posts: 3
Joined: 2011-11-09T12:57:56-07:00
Authentication code: 8675308

How to extract the compare parametr (1.#inf) for further use

Post by antananarivu »

Hi guys, i've been looking for the compare program for a long time and found image magick - thats great

and this one works from cmd it just the thig i was looking for

I am using Imagemagick's Compare.exe.

My problem is how to handle the "1.#INF" and output it to the file or somewhere, to use it further with powershell script

can somebody help me please
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to extract the compare parametr (1.#inf) for further

Post by fmw42 »

I am not a windows user, but the compare results go to std error, so in unix one would do:


string=`compare -metric rmse rose: rose: null: 2>&1`
echo $string
0 (0)

I do not know how to do this in windows, but you may get some ideas from http://www.imagemagick.org/Usage/windows/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to extract the compare parametr (1.#inf) for further

Post by anthony »

I am not certain what you mean by 1.#inf
The 'inf' looks like a floating-point infinite value, but I have never seen that output from compare.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
antananarivu
Posts: 3
Joined: 2011-11-09T12:57:56-07:00
Authentication code: 8675308

Re: How to extract the compare parametr (1.#inf) for further

Post by antananarivu »

anthony wrote:I am not certain what you mean by 1.#inf
The 'inf' looks like a floating-point infinite value, but I have never seen that output from compare.

if i compare two identical images, i get the cmd line 1.#inf


so it looks like

"ImageMagick\compare.exe" -metric PSNR "Screenshots\first.jpg" "Screenshots\second.jpg" "Screenshots\difference.png"
1.#inf

and it creates me the file difference.png which shows the difference (if it is present)

but i need this 1.#inf or something to use like the condition that the images are identical
antananarivu
Posts: 3
Joined: 2011-11-09T12:57:56-07:00
Authentication code: 8675308

Re: How to extract the compare parametr (1.#inf) for further

Post by antananarivu »

fmw42 wrote:I am not a windows user, but the compare results go to std error, so in unix one would do:


string=`compare -metric rmse rose: rose: null: 2>&1`
echo $string
0 (0)

I do not know how to do this in windows, but you may get some ideas from http://www.imagemagick.org/Usage/windows/

thats great i managed with it =))) it looks like

compare.cmd >log.log 2>&1

thanks to all =)))
Post Reply