Skip to content

Instantly share code, notes, and snippets.

@adamhotep
Created December 2, 2017 20:25
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 adamhotep/f1376902e72d86e4e198dcb0d700608c to your computer and use it in GitHub Desktop.
Save adamhotep/f1376902e72d86e4e198dcb0d700608c to your computer and use it in GitHub Desktop.
xcf2jpg
# make a "jpg" directory
# loop on each file ending in ".xcf" calling each iteration "$image"
# convert (an ImageMagick tool, `apt install imagemagick`) the image
# the second argument removes the trailing ".xcf" and adds ".jpg"
# which tells `convert` that we want to change the format
# (the second argument also places the converted file into the "jpg" dir)
mkdir jpg
for image in *.xcf; do convert "$image" "jpg/${image%.xcf}.jpg"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment