Skip to content

Instantly share code, notes, and snippets.

@quangson91
Forked from rafaelrinaldi/to_png.sh
Created November 30, 2016 23:52
Show Gist options
  • Save quangson91/c58a183ea1406592f919b251490e99e0 to your computer and use it in GitHub Desktop.
Save quangson91/c58a183ea1406592f919b251490e99e0 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