This script, ddstopng.py, recursively searches for .dds files in a folder and its subfolders that start with the word store and converts them to .png format. It skips conversion if the .png version of a file already exists.
- Python 3.6 or later
- Pillow library for image processing
- Clone or download this repository to your local machine.
- Install the required dependencies using
pip:pip install -r requirements.txt
-
Open a terminal or command prompt.
-
Run the script with the following command:
python ddstopng.py [folder_path]
- Replace
[folder_path]with the path to the folder containing.ddsfiles. If no folder path is provided, the script defaults to:C:\Program Files (x86)\Steam\steamapps\common\Farming Simulator 25\data
- Replace
To use the default folder path, simply run:
python ddstopng.pyTo specify a custom folder path:
python ddstopng.py "C:\Users\YourUser\Documents\Textures"- The script will:
- Search for
.ddsfiles starting withstorein the specified folder and subfolders. - Convert each
.ddsfile to.pngformat and save it in the same directory. - Skip conversion for
.ddsfiles if the.pngversion already exists.
- Search for
The script provides detailed logs in the terminal:
Found X DDS files.: Indicates how many.ddsfiles were located.Converted: [file_path] -> [png_path]: Displays successful conversions.Skipping (png already exists): [png_path]: Skips files if the.pngalready exists.
- Ensure that the folder path provided has read/write permissions.
- The
.ddsfiles must be valid and supported by thePillowlibrary. - If an unsupported
.ddsfile is encountered, the script will skip it and log an error.
If you encounter issues with missing dependencies, ensure you have installed them using:
pip install -r requirements.txtIf a .dds file fails to convert, ensure it is compatible with the Pillow library. Some .dds formats may require additional plugins.
This project is open-source and available under the MIT License.