Skip to content

Instantly share code, notes, and snippets.

@bencrowder
Last active January 27, 2019 18:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bencrowder/5091137 to your computer and use it in GitHub Desktop.
Save bencrowder/5091137 to your computer and use it in GitHub Desktop.
Shell script to split two-spread image into two different images. Uses ImageMagick.
#!/bin/sh
# Split two-spread image into two different images (leaving some overlap for safety)
# Usage: splitimage filename.jpg
# ----------------------------------------------------------------------------------
convert $1 -crop 56x100%+0+0 +repage output/`basename $1 .jpg`a.jpg
convert $1 -flop -crop 60x100%+0+0 -flop +repage output/`basename $1 .jpg`b.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment