2022-07-26 02:00:30 +00:00
|
|
|
import os, pixie, strformat, strutils
|
2022-07-09 05:56:18 +00:00
|
|
|
|
2022-07-09 18:08:34 +00:00
|
|
|
proc xray*(image: Image, masterPath: string) =
|
2022-07-09 05:56:18 +00:00
|
|
|
let
|
2022-07-10 06:26:52 +00:00
|
|
|
generatedPath = "tmp/generated/" & masterPath
|
|
|
|
xrayPath = "tmp/xray/" & masterPath
|
|
|
|
createDir(generatedPath.splitPath.head)
|
|
|
|
createDir(xrayPath.splitPath.head)
|
|
|
|
image.writeFile(generatedPath)
|
2022-07-09 05:56:18 +00:00
|
|
|
let
|
|
|
|
master = readImage(masterPath)
|
|
|
|
(score, xRay) = diff(image, master)
|
2022-07-10 06:26:52 +00:00
|
|
|
xRay.writeFile(xrayPath)
|
|
|
|
echo &"xray {masterPath} -> {score:0.6f}"
|