Page 1 of 1

Command Line convert DDS to DXT1/DXT5 specifically

Posted: 2019-07-26T06:33:57-07:00
by Pekempy
Hi, I'm using a tool which uses Imagemagick to convert from jpg/png etc to DDS. Some images need to be DXT1 and some need to be DXT5. The main need is DXT1 as this is for the main images.

In the help files it states that occasionally ImageMagick uses DXT5 even if DXT1 is specified using command line args.

Is there a way to ensure DXT1 is used for certain conversions and DXT5 is used otherwise?

Command I'm using is:

Code: Select all

convert -format dds -define dd:mipmaps=1 -define dds:compression=DXT1 'input_file.xxx' 'output_file.dds'

Re: Command Line convert DDS to DTX1/DTX5 specifically

Posted: 2019-07-26T08:42:53-07:00
by fmw42
From the format page at https://imagemagick.org/script/formats.php
DDS RW Microsoft Direct Draw Surface Use -define to specify the compression (e.g. -define dds:compression={dxt1, dxt5, none}). Other defines include dds:cluster-fit={true,false}, dds:weight-by-alpha={true,false}, dds:fast-mipmaps={true,false}, and use dds:mipmaps to set the number of mipmaps (use fromlist to use the image list).
Have you tried

Code: Select all

-define dds:compression=dxt1

Re: Command Line convert DDS to DXT1/DXT5 specifically

Posted: 2019-07-26T08:55:22-07:00
by Pekempy
Hey,

I do have that in the original command we're using, but the only difference appears to be the lowercase dxt? is that important? so DXT1 wouldn't be the same as dxt1?

Could this be why when we check they're not always compressing correctly?

Re: Command Line convert DDS to DXT1/DXT5 specifically

Posted: 2019-07-26T10:04:37-07:00
by fmw42
I doubt it, but it is easy to check. Just try the lower case and see if it works.

Otherwise, perhaps a bug.

Try rearranging to proper syntax order

Code: Select all

convert  'input_file.xxx' -define dd:mipmaps=1 -define dds:compression=dtx1 'DDS:output_file.dds'