Fallout New Vegas

File information

Last updated

Original upload

Created by

DC - dont care

Uploaded by

DullCandle29

Virus scan

Safe to use

Tags for this mod

About this mod

Simple batch file I made that loops through images in a folder and converts them to DDS with Texgenpack, a free DDS converter.
I'm no computer programer so there are bound to be bugs/errors. Corrections/Improvements requested!

Requirements
Permissions and credits
Changelogs


I made a WAY better batch script DDS converter that runs much faster and looks much better


https://www.nexusmods.com/fallout4/mods/46817

It converts 2MB 1080p images in less than a second :o, it supports the high quality BGRA8 uncompressed format for high quality lossless conversions, meanwhile texgen takes literal hours to generate a high quality image...




Use this batch DDS converter to create up to 200 custom loading screens to personalize your loading experience using my DIY Load Screens Mod

If you don't like this "converter" that compresses the image and would like to use a better converter with a gui, take a look at this article.
https://listoffreeware.com/bmp-to-dds-converter-software-windows/
For more free DDS converters.

Note: Get the latest version (v0.9.6 as of now) of Texgenpack from github (link)
So apparently there's a linux version of Texgenpack that's been developed more, and it even has a gui... It can also convert to DDS without
needing to render a compression. However I haven't looked into it yet
and I don't know if it can batch convert either.

For some reason using the DXT1 format gives glitchy artifacts where some pixels are missing/erased, DXT5 seems to have fixed that issue.
Also if the "PNGtoDDS" folder is empty or has no supported image, the .bat files won't do anything.

PSA: Windows CMD has a "feature" called quick edit enabled by default that pauses/freezes the CMD process until you exit "Select" mode. You can disable it by opening CMD as administrator and going into the CMD properties, see relevant screenshot for quick tutorial.

- Because the conversion requiers compression, the DDS generated won't look exactly as good as the original image that's being converted, but it will (or may) perform better in game and the quality difference shouldn't be too noticable. Still it's a good idea to keep the original images so that you can always reconvert them without degrading the quality too much.

- Unfortunatly this only works for PNG images, but at least you can still use a free batch converter like Honeyview to batch convert most image formats into PNG before converting them to DDS (link)

- There are lot's of different paramaters you can mess around with to get different results, so far the "--slow" method has given the best image quality but is really slow. I'm still experimenting with different paramaters, including the "--islands" and  "--generations" which seem to affect conversion speed & quality. But the "OPTIMIZED " bat should be the best one to use (other than "SLOW" of course).

- This is a WIP, I couldn't figure out how to save the output DDS file to a different folder or how to remove its previous extention.

- I recommend removing the DDS files it generates before running again to prevent it from creating duplicate DDS files.

- Corrections/Improvements requested!

[Known Bugs/Errors]
> Sometimes the image processing pauses/freezes and you need to go into the CMD window and move/press your keyboard to wake up/update the window. Or else it won't be doing anything Turns out this was caused by a windows 10 feature called "Quick Edit Mode" which can be disabled in the CMD properties.
> The converted images have the previous extension in the file name (image.png will be image.png.dds)
> The batch converter cannot tell the difference between a PNG or DDS file and will reconvert/recompress any DDS files it finds in the "PNGtoDDS" folder. So its best to move or delete any DDS images you've converted.


[To DO]

I'm still trying to figure out batch programming so my next goals are
> Move the output to a different folder
> Find an optimized fast & high quality conversion paramater
> Make the Test scripts write the compression duration on the images it generates.
> Re-write the test scripts so they are easier to configure
> Find a faster/better way to batch convert DDS images....

[Q & A]
Q: What is this?
A: Nothing more than a .bat file with a single loop command.

Q: So how does it work?
A: Whenever running the .bat, it goes through the "PNGtoDDS" folder and looks for files, if it finds a file it will run the Texgenpack program through a CMD command. If the image is not supported it will either give an error or not convert the image, otherwise it will start converting it to DDS.

The output file will still have its previous extension ("image.png" will be "image.png.dds" for example)
So use this free program to remove/rename the file name extension:
https://www.bulkrenameutility.co.uk/
Using the "replace" option, just input the extension to remove, Replace".png" and leave the "With" entry empty.
Look at the screenshot for more info.
 -------------------------------

Tutorial:
1) Download the latest version of Texgenpack:
https://github.com/hglm/texgenpack/releases

You will also need "pthreadVC2.dll" from here
ftp://sourceware.org/pub/pthreads-win32/prebuilt-dll-2-9-1-release/dll/x86/

DLL Source (in case the link above does not work):
https://sourceware.org/pthreads-win32/

2) Extract the folder anywhere, preferably in a directory without admin requierments (e.g. Users directory like Desktop or Downloads etc...)

3) Save/move the "pthreadVC2.dll" to the "texgenpack\Release\" directory where the texgenpack.exe is located.

4a) Either download and extract my bat files to the "texgenpack\Release" directory where the texgenpack.exe is located.

or

4b) Open notepad and copy paste this code into it, then save it as a bat file in "texgenpack\Release\" example = "texgenpack\Release\convert.bat"
You must save it as a .bat file, windows 10 hides file extensions by default and will save the file as "convert.bat.txt" if you have file extensions hidden. You can unhide file extensions by clicking the "File" button on the top left of the "File Explorer" window and going into the "Change folder and search options" Under the "View" tab, look for the "Hide extensions for known file types" box and uncheck that annoying "feature"....

You can choose whichever .bat version you perfer from below, I recommend using OPTIMIZED .bat #3. After doing some quick testing the Normal.bat runs faster than the Fast.bat LOL quality should be about the same but the paramaters can still be improved.

"1 - FAST convert to DDS.bat"
IF NOT EXIST "PNGtoDDS\" mkdir PNGtoDDS\
FOR %%i IN (PNGtoDDS\*.PNG*) DO start /w cmd.exe /k "texgenpack.exe --compress --fast --format dxt5 --progress "%~dpnx1%%i" "%~dpn1%%i.dds" & exit"


"2 - Normal convert to DDS.bat"
IF NOT EXIST "PNGtoDDS\" mkdir PNGtoDDS\
FOR %%i IN (PNGtoDDS\*.PNG*) DO start /w cmd.exe /k "texgenpack.exe --compress --format dxt5 --islands 16 --generations 100 --progress "%~dpnx1%%i" "%~dpn1%%i.dds" & exit"


"3 - OPTIMIZED convert to DDS.bat"
IF NOT EXIST "PNGtoDDS\" mkdir PNGtoDDS\
FOR %%i IN (PNGtoDDS\*.PNG*) DO start /w cmd.exe /k "texgenpack.exe --compress --format dxt5 --islands 64 --generations 80 --progress "%~dpnx1%%i" "%~dpn1%%i.dds" & exit"

"4 - SLOW convert to DDS.bat"

IF NOT EXIST "PNGtoDDS\" mkdir PNGtoDDS\
FOR %%i IN (PNGtoDDS\*.PNG*) DO start /w cmd.exe /k "texgenpack.exe --compress --slow --format dxt5 --progress "%~dpnx1%%i" "%~dpn1%%i.dds" & exit"


You can use "--fast" if you don't care about quality and want faster conversions, or lower the optimized bat parameters to  --islands 8 --generations 80

4c) Double click the .bat file and a new folder should appear.

5) Move/Copy your images to the "PNGtoDDS" folder, they must be PNG images or compatible with Texgenpack, IIRC 24-bit PNG worked for me but 8-bit gave me an error.

6) Run the bat, 2 CMD windows will open up, one will show what the batch file is doing, the other will be Texgenpack converting an image. When the first image finishes processing, the CMD window will automatically close and start converting the next image. After all images are done processing the CMD windows will close. You can cancel any image conversion at any time, if done so the CMD window will prompt "Terminate batch job (Y/N)?" Inputing "Y" or closing the CMD window will end the batch conversion.

7) ???

8) Profit, don't forget to hit that "endorsement" and leave a "star"

I'm not a computer programer so there are bound to be bugs/errors. Corrections/Improvements requested!

Simple DDS viewer w/ batch converter from DDS to JPG/PNG/BMP but cannot convert to DDS unfortunatly.
https://www.bandisoft.com/honeyview/

Free ZIP & 7z Archive Manager
https://www.bandisoft.com/bandizip/

DDS image editor + converter (technically a converter since you can open any supported image like a PNG and save it as DDS, however not a batch
converter)
https://www.getpaint.net/index.html

-------------------------------

[Copy Restrictions]
This isn't really that important to me, nor do I care much about this mod.
You're free to mess with and make your own versions of this mod, as well as share/upload it.
Just don't break any laws/copyright infringements like reuploading others people work or what not

I'm not sure what else there is for me to say or mention, so happy modding I guess :D