Skip to content

Instantly share code, notes, and snippets.

@sweetmandm
Created December 19, 2012 02:30
Show Gist options
  • Save sweetmandm/4333869 to your computer and use it in GitHub Desktop.
Save sweetmandm/4333869 to your computer and use it in GitHub Desktop.
Script to batch-convert a directory of PNG files to iOS-compativle PVR using the PVRTexTool command-line tool.
#! /bin/sh
# Batch process png to pvr conversion
# using PVRTexTool Command-line tool
#take all files of this type:
filetype="png"
#take them from here:
sourcedir="./"
#put them here:
destdir="./"
#use this path for pvrtextool:
pvrtool=" ***YOUR PATH TO PVRTEXTOOLCL GOES HERE*** /PVRTexTool/PVRTexToolCL/MacOS_x86/PVRTexTool"
#run the batch:
cd "$sourcedir"
for i in *."$filetype"; do
"$pvrtool" -m -pvrlegacy -foglpvrtc4 -premultalpha -pvrtcbest -yflip 1 -i "$i" -o "$destdir""$i"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment