public
Last active

  • Download Gist
eirikmagick.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
tmpdir=tmp
if [ -d "$tmpdir" ]; then
rm -rf $tmpdir
fi
mkdir $tmpdir
height=2592
width=10
n=0
for f in *.jpg
do
offset=$(($n*$width))
c="$(printf "%05d" $n)"
echo "Creating slice $tmpdir/$c.png"
convert -crop ${width}x${height}+${offset}+0 $f $tmpdir/$c.png
n=$(($n+1))
done
 
count="$(ls -1 $tmpdir | wc -l)"
echo "Joining $count slices into out.png"
montage $tmpdir/*.png -mode concatenate -tile ${count}x out.png

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.