Author Topic: png2dds script  (Read 719 times)

sithlord48

  • *
  • Posts: 1563
  • Dark Lord of the Savegame
    • View Profile
    • Blackchocobo
png2dds script
« on: 2020-05-15 03:06:57 »
Hey all. I wrote this little script for users on linux or mac os who want to convert png2dds files.

1. Install imagemagick from your package manager
2. Save this a png2dds.sh
Code: [Select]
for D in `find . -type d`
do
    for file in "$D"/*.png
    do
        if [ "$file" != "./*.png" ]; then
            convert $file "$(echo $D | cut -c3-)/$(basename "$file" .png).dds"
        fi
    done
done
run with png2dds.sh it will convert every png file from this folder recursively into a dds file with the same name in the same path as the png file.

To remove png files after the script is done
Code: [Select]
find . -name *.png -delete

satsuki

  • *
  • Posts: 507
    • View Profile
    • My softs (french only)
Re: png2dds script
« Reply #1 on: 2020-05-15 05:57:11 »
Warning
DDs is a contairer with can use several compression m├ęthods.
ATM imagemagick can't use dc7, it's use dxt5 max so you'll realy loose in quality comparing to dc7.