Skip to content

Commit

Permalink
synced
Browse files Browse the repository at this point in the history
  • Loading branch information
spodzone committed Sep 3, 2018
1 parent 177a07a commit aab6cee
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Empty file modified README.md
100755 → 100644
Empty file.
30 changes: 15 additions & 15 deletions stack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ info("Starting")

info("Loading modules")

#using Images, Color, FixedPointNumbers
using Images, FixedPointNumbers

function imageinterpolate(img1, img2, prop=0.5)
"Return a new image interpolated prop proportion of the way from img1 to img2"
img1=float32(img1)
img2=float32(img2)
img1b=reshape(data(img1),(width(img1)*height(img1)))
img2b=reshape(data(img2),(width(img2)*height(img2)))

d=[ img1b[i]+ (img2b[i]-img1b[i])*prop for i in 1:length(img1b) ]
img3b=reshape(d, (width(img1), height(img1)))
copy(img1, img3b)
"Return a new image interpolated PROP-proportion of the way from img1 to img2 (arrays)"
d=[ img1[i]+ (img2[i]-img1[i])*prop for i in 1:length(img1) ]
d
end


fname=ARGS[1]
info("Loading image 1: [$fname]")
rolling=imread(ARGS[1])
rolling=load(ARGS[1])
w,h,props = (width(rolling), height(rolling), properties(rolling))

for i in 2:length(ARGS)
fname=ARGS[i]
info("Loading image $i: [$fname]")
img=imread(fname)
img=load(fname)
img=reshape(data(float32(img)), w*h)
n=imageinterpolate(rolling, img, 1/i)
rolling=deepcopy(n)
end

# rolling=convert(Image{HSV}, rolling)
rolling=convert(Image{RGB}, rolling)
info("Converting final format")
rolling=reshape(rolling, (w,h))
rolling=convert(Image{Images.RGB24}, rolling)

imwrite(rolling, "output.exr")
info("Saving")
#info(" EXR")
#imwrite(rolling, "output.exr")
info(" PNG")
imwrite(rolling, "output.png")
info(" TIFF")
imwrite(rolling, "output.tiff")

info("All done")

0 comments on commit aab6cee

Please sign in to comment.