Created
February 19, 2016 17:38
-
-
Save camb416/c5f45520e2f066697f1b to your computer and use it in GitHub Desktop.
One week series. Slicing images from top to bottom over time.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# One week series. Slicing images from top to bottom over time. | |
# http://cameronbrowning.com/content/one-week-series/ | |
# Originally adapted from earlier work at: | |
# http://cameronbrowning.com/content/creating-slit-scan-images-from-quicktime-movies-with-ffmpeg-on-mac-os-x/ | |
# Step 1: loop through 10,078 images | |
for i in `seq -f "%05g" 1 10078`; | |
do | |
# subtract 1 from the counter for the y offset | |
# mycmd=$(printf "mogrify -crop 352x1+0+%d image-%04d.jpg\n" `expr "$i" - "1"` $i) | |
whichfile=$(printf "$i.jpg") | |
myvar=$(expr "$i" \* "240" / "10078") | |
# output the command that's about to be executed | |
# so you can see progress | |
mycmd="mogrify -crop 352x1+0+$myvar $whichfile" | |
echo $mycmd | |
# then execute it. | |
$mycmd | |
done | |
# after this execute this to generate the tall scan: | |
# montage *.jpg -tile 1x -mode concatenate tallscan.png | |
# then lets slice the tall scan into 7 chunks | |
# (by omitting the offset in the crop param, it auto slices) | |
# convert tallscan.png -crop 352x1440 tallslice.png | |
# now stick them together | |
# montage tallslice-*.png -tile x1 -mode concatenate tallslice_combined.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment