Skip to content

Instantly share code, notes, and snippets.

@marcust
Created February 27, 2016 12:58
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 marcust/f4167c8a171b3dca1b0e to your computer and use it in GitHub Desktop.
Save marcust/f4167c8a171b3dca1b0e to your computer and use it in GitHub Desktop.
#!/bin/sh
set -ue
IMAGE_WIDTH=692
IMAGE_HEIGHT=692
WIDTH=28
HEIGHT=21
COUNT=$(($WIDTH * $HEIGHT))
echo "Using $COUNT random images for image ${WIDTH}x${HEIGHT}"
rm -f generated/*
for i in $(seq 1 9); do
IMAGES=$(ls -1 *.jpg | shuf | head -n $COUNT)
echo -n "Creating $i... "
montage $IMAGES -tile ${WIDTH}x${HEIGHT} -geometry ${IMAGE_WIDTH}x${IMAGE_HEIGHT}+0+0 -border 10 -bordercolor black -background black miff:- | convert - -bordercolor black -border 25 generated/$i.jpg;
echo "DONE"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment