Skip to content

Instantly share code, notes, and snippets.

@marcust
Created February 27, 2016 12:58

Revisions

  1. marcust created this gist Feb 27, 2016.
    21 changes: 21 additions & 0 deletions generate.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    #!/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