Skip to content

Instantly share code, notes, and snippets.

@Wikinaut Wikinaut/make-polaroid.sh
Last active Jun 1, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.