Building a stack of images from thumbnails
I have a directory full of thumbnails of the rental tour I went on the other day while looking for a new apartment, and I want to put them online. Instead of putting each photo online, which I thought might be boring, I wanted to build a stack on images on a background. I'm not really describing the effect well, so here's the output so you know what I mean: This was remarkably easy to create with a simple script that uses ImageMagick. Here's the code: #!/bin/bash # Setup the random number stuff LOBOUND=1 HIBOUND=600 RANDMAX=32767 # Create a white image to start with convert -size $HIBOUND"x"$HIBOUND xc:lightgray output.png for img in img*jpg do echo "Processing $img" # Rotate the image if needed rotate="" if [ `exif $img | grep Orientation | grep bottom | wc -l | tr -d " "` -gt 0 ] then convert -rotate -90 $img img.png else convert $img img.png fi imgwidth=`identify -ping img.png | cut -f 3 -d " " | cut -f 1 -d "x"` imgheight=`identify -ping img.png | cut -f 3 -d " " | cut -f 2 -d "x"` # For more information on bounded numbers with bash, see # http://www.stillhq.com/bashrand/…