2020 DDS Texture Tools Standalone - Command Line

Hi Folks,

Just downloaded the 2020 DDS Texture Tools Standalone - I’m looking at the command line options - is there a way to add an alpha channel to an image that doesn’t have one - so effectively combining two images and specifying one as the alpha ? If so - could I just get a basic example to start me off ?

Thanks.

Regards,
Scott

Hi Scott!

There isn’t a way to do this using the Texture Tools Exporter Standalone by itself to the best of my knowledge – each command line currently uses a one-image-in, one-image-with-mips-out model (treating a batch file as a set of command lines).

However, it’s possible to combine the channels using ffmpeg or ImageMagick from the command line, and then use the exporter standalone to convert to DDS. For instance, if I want to use the alpha channel in a.png with an RGB image in rgb.png to get a file called rgba.png, I could use

ffmpeg -i rgb.png -i a.png -filter_complex "[1:v]alphaextract[a];[0:v][a]alphamerge" rgba.png

or

magick rgb.png ( a.png -channel a -separate ) -alpha off -compose CopyOpacity -composite rgba.png

and then use

nvtt_export rgba.png -f bc7 rgba.dds

to convert it to a BC7 DDS file.

Hope this helps,

–Neil