Page 1 of 1

diffence in text.txt using vbscript

Posted: 2011-08-12T01:00:25-07:00
by adelina
Hi...so i using this command "
"dim i
set objArgs = WScript.Arguments

set img = CreateObject("ImageMagickObject.MagickImage.1")
do

para1=inputbox ("dati parametrul 1")
Wscript.Echo "Primul argument:" + para1

para2=inputbox ("dati parametrul 2")
Wscript.Echo "Al doilea parametru:" + para2

msgs = img.Compare("-metric","RMSE", "-subimage-search",para1, para2,"2", ">", "pararez.txt")
i= i+1
loop while(i < objArgs.length )"


and I want to put in "pararez.txt" the difference between those to pictures ,like it does in imagemagick ,but instead of that ,it puts me all the pixels.How do i fix it?

Re: diffence in text.txt using vbscript

Posted: 2011-08-12T03:57:19-07:00
by adelina
or has vbscript a different command to write in .txt? the command "2>pararez.txt" is from imagemagick and I thought tha it may work in vbscript too,but it dosen't! this is what i get :

# ImageMagick pixel enumeration: 507,430,255,rgba
0,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
1,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
2,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
3,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
4,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
5,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
6,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
7,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
8,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
9,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
10,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
11,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
12,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
13,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
14,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
15,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
16,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
17,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
18,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
19,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
20,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
21,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
22,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
23,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
24,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
25,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
26,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
27,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
28,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
29,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
30,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
31,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
32,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
33,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
34,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
35,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
36,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
37,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
38,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
39,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
40,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)
41,0: (253,253,248,255) #FDFDF8 rgba(253,253,248,1)

And i don't need this!i need only the difference between them!

Re: diffence in text.txt using vbscript

Posted: 2011-08-14T05:05:50-07:00
by whugemann
Your problem basically has nothing to do with VBScript, it's just about using Compare correctly. So you might strip it down to the real question.

It doesn't really help the solution if you provide source code spiced with input in your mother language. This is an international forum.

As said in http://www.imagemagick.org/Usage/windows/#vb_testing, you should first of all ensure that your command line is doing what you would like it to do, before placing it in a VBScript.

For this two-paired comparison, you don't need a VBScript at all. It could be done in Windows batch file just as well, with something like:

Code: Select all

SETLOCAL ENABLEDELAYEDEXPANSION
SET COUNT=0
SET TFILE=FIRST
MD Comp
FOR %%i in (%*) DO (
compare -metric RMSE "!LAST!" "%%i" dump  2>>Differences.txt
SET LAST=%%i
  SET /A COUNT+=1
  SET TFILE=0!COUNT!
  SET TFILE=!TFILE:~-2!
)
DEL comp\FIRST.JPG