Skip to content

Instantly share code, notes, and snippets.

@idoru
Created March 13, 2011 20:55
Show Gist options
  • Select an option

  • Save idoru/868433 to your computer and use it in GitHub Desktop.

Select an option

Save idoru/868433 to your computer and use it in GitHub Desktop.
Automate the creation of low fidelity assets from Retina assets. Uses CoreImageTool by Marc Liyanage (http://www.entropy.ch/software/macosx/coreimagetool/)
#!/bin/sh
#Get CoreImageTool from http://www.entropy.ch/software/macosx/coreimagetool/
CONVERTER=/usr/local/bin/CoreImageTool
for FILE in $(find . -name \*-hd.png)
do
TARGET=$(echo $FILE | sed -e s@-hd\.png@\.png@)
echo $FILE \=\> $TARGET
$CONVERTER load pic $FILE filter pic CILanczosScaleTransform scale=0.5 store pic $TARGET public.png
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment