Skip to content

Instantly share code, notes, and snippets.

@rafaelrinaldi
Created October 8, 2012 03:21
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rafaelrinaldi/3850548 to your computer and use it in GitHub Desktop.
Save rafaelrinaldi/3850548 to your computer and use it in GitHub Desktop.
Convert .psd files to .png files keeping the transparency.
#!/usr/bin/env bash
#
# Convert .psd files to .png files keeping the transparency.
# It uses `imagemagick` library.
# Usage:
#
# sh to_png.sh path/
#
# Author: Rafael Rinaldi (rafaelrinaldi.com)
# Since: Oct 7, 2012
#
for f in $1/*.psd;
do
base=${f%\.*};
convert $f -background transparent -flatten $base.png
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment