I'm capturing alot of screenshots and compare them with the -compare command (IMobject.dll), then stack the results ontop of eachother, in a "grayscalish" way.
It's works fine and I'm happy, but I could be even happier if someone could help me getting it all into one command only, as that should easily be possible, but dunno how to do it.
What it does....
takes hg1.png and compare it with hg2.png, and spit out the difference in 16bit pgm as diff.pgm (notice the color change every loop)
then they are all stacked using -compose darken, as result.pgm (that overwrites itself all the time, intended and works good)
Code: Select all
Func stackimages()
$compcolor = ($min-$min)+1
$canvas = $img.Convert("-size", "512x512", "xc:white", "-depth", "16", "-compress", "none", "g:/temp/result.pgm")
For $height = $min to $max
;---------------screen area gets captured here and saved as "hg1.png"-----------------
;-----------stuff happens here that changes the screen area----------------
;---------------same screen area gets captured here and saved as "hg2.png"-----------------
$compare = $img.Compare("g:/temp/hg1.png", _
"g:/temp/hg2.png", _
"-depth", "16", _
"-compress", "none", _
"-compose", "Src", _
"-highlight-color", "#" & Hex(($compcolor+1)*64,4) & Hex(($compcolor+1)*64,4) & Hex(($compcolor+1)*64,4), _
"g:/temp/diff.pgm" )
$composite = $img.Composite("-depth", "16", _
"-compress", "none", _
"-compose", "Darken", _
"g:/temp/result.pgm", _
"g:/temp/diff.pgm", _
"g:/temp/result.pgm" )
$compcolor = $compcolor+1
Next
EndFunc
Could someone help me with this please ?
Werty