Last active
June 1, 2018 19:05
-
-
Save Wikinaut/6fd97284213409d9cd14c5bb73bef06a to your computer and use it in GitHub Desktop.
Make a polaroid-style photo montage (make-polaroid)
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 | |
d=$(pwd) | |
lastDirectoryComponent=${d##*/} | |
title=$lastDirectoryComponent | |
if [ -n "$1" ]; then | |
title="$1 ($lastDirectoryComponent)" | |
fi | |
# outfilename="polaroid.jpg" | |
outfilename="${lastDirectoryComponent}.polaroid.jpg" | |
resolution="1000" | |
tile="4x4" | |
captionpointsize="20" | |
# Image label escapes: see https://www.imagemagick.org/script/escape.php | |
# %f filename | |
caption="%f" | |
montage $(ls *.jpg *.JPG |grep -v "$outfilename" | sort -n) -thumbnail ${resolution}x${resolution} -set caption "$caption" -background grey40 -pointsize $captionpointsize +polaroid -background white -geometry +1+1 -tile $tile -title "$title" polaroid.jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment