Created
March 31, 2016 15:55
-
-
Save eZanmoto/5f7884aebe7bb9a45ceae06658e58b2a to your computer and use it in GitHub Desktop.
Creates a 3:2 image from 3 square images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: bash tri-img.sh src1.png src2.png src3.png tgt.png | |
set -e | |
DIR=$(mktemp -d -t '') | |
convert "$1" -resize 240x240 "$DIR"/1.png | |
convert "$2" -resize 118x118 "$DIR"/2.png | |
convert "$3" -resize 118x118 "$DIR"/3.png | |
convert "$DIR"/1.png -size 4x120 xc:white '(' "$DIR"/2.png -size 118x4 xc:white "$DIR"/3.png -append ')' +append -background white $4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script requires ImageMagick, and the format of the
mktemp
command needs to be changed if using Linux. Source images should have even-length sides to avoid white borders in the output image.