Last active
June 12, 2016 17:35
-
-
Save riccardobl/eb4efe33de3dd705d69775de43864e59 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Convert images to dds files with mipmaps and compression using imagemagick. | |
#Requirements | |
Imagemagick >= 6.8.6-10 : https://gist.github.com/riccardobl/3aabaf82f74675a7b75b5878a5411789 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage | |
# $> ddsgamecnv output_folder/ file.png | |
# $> ddsgamecnv output_folder/ *.png | |
# $> ddsgamecnv output_folder/ file1.png file2.png file3.png | |
out_dir=$1 | |
for f in "${@:2}"; do | |
out=`basename "$f"` | |
out="${out%.*}" | |
out="$out_dir/$out.dds" | |
echo "Convert $f in $out" | |
convert -format dds -filter Mitchell -define dds:compression=DXT5 -define dds:mipmaps=5 "$f" "$out" | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment