Skip to content

Instantly share code, notes, and snippets.

@Wikinaut
Last active June 1, 2018 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wikinaut/6fd97284213409d9cd14c5bb73bef06a to your computer and use it in GitHub Desktop.
Save Wikinaut/6fd97284213409d9cd14c5bb73bef06a to your computer and use it in GitHub Desktop.
Make a polaroid-style photo montage (make-polaroid)
#!/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