Skip to content

Instantly share code, notes, and snippets.

@christopherobin
Created June 27, 2017 06:31
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 christopherobin/e57246df11a2b01afbfee20fc9bd0a67 to your computer and use it in GitHub Desktop.
Save christopherobin/e57246df11a2b01afbfee20fc9bd0a67 to your computer and use it in GitHub Desktop.
This will take a folder full of images, resize them to the target size and stitch them side by side
SCREEN_RES=2560x1440
mkdir result 2>/dev/null || true
for a in *.jpg; do for b in *.jpg; do
[[ "$a" != "$b" ]] && \
convert \
"$a" -resize "${TARGET_RES}^" -gravity center -crop "${TARGET_RES}+0+0" +repage \
"$b" -resize "${TARGET_RES}^" -gravity center -crop "${TARGET_RES}+0+0" +repage \
+append "result/${a}-${b}";
done; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment