-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack.jl
More file actions
executable file
·53 lines (40 loc) · 965 Bytes
/
stack.jl
File metadata and controls
executable file
·53 lines (40 loc) · 965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env julia
function tlog(str)
tm=time()
println("[$tm] - $str")
end
tlog("Starting")
tlog("Loading modules")
using Images
function imageinterpolate(img1, img2, prop=0.5)
"Return a new image interpolated PROP-proportion of the way from img1 to img2 (arrays)"
d = img1 + (img2-img1)*prop
d
end
fname=ARGS[1]
tlog("Loading image 1: [$fname]")
rolling=load(ARGS[1])
w,h=size(rolling)
for i in 1:length(ARGS)
fname=ARGS[i]
tlog("Loading image $i [$fname]")
img=load(fname)
img = RGB{Float16}.(img)
if(i==1)
global rolling=deepcopy(img)
else
n=imageinterpolate(rolling, img, 1/i)
global rolling=deepcopy(n)
end
end
tlog("Converting final format")
rolling=reshape(rolling, (w,h))
tlog("Saving")
#info(" EXR")
#save("output.exr", rolling)
tlog(" PNG")
rolling=RGB{N0f16}.(rolling)
save("output.png", rolling)
tlog(" TIFF")
save("output.tiff", rolling)
tlog("All done")