How to convert many tga to dds?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
winmisha
Posts: 3
Joined: 2019-04-18T07:20:13-07:00
Authentication code: 1152

How to convert many tga to dds?

Post by winmisha »

How to convert many tga to dds?
The folder "Img", inside the files "tga"
Save with these settings.
https://yadi.sk/i/EzJAy9Itc8GROA

1

Code: Select all

C:\ImageMagick\convert.exe -format dds -define dds:mipmaps=0 -define dds:compression=a8r8g8b8 C:\Img\*.tga C:\Img\*.dds
2

Code: Select all

C:\ImageMagick\convert.exe -format dds -define dds:mipmaps=5 -define dds:compression=dxt1 C:\Img\*.tga C:\Img\*.dds
3

Code: Select all

C:\ImageMagick\convert.exe -format dds -define dds:mipmaps=0 -define dds:compression=dxt1 C:\Img\*.tga C:\Img\*.dds
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to convert many tga to dds?

Post by snibgo »

To process all the files in a folder, I suggest you either use "mogrify" instead of "convert", or use a "for" loop.
snibgo's IM pages: im.snibgo.com
winmisha
Posts: 3
Joined: 2019-04-18T07:20:13-07:00
Authentication code: 1152

Re: How to convert many tga to dds?

Post by winmisha »

snibgo wrote: 2019-04-18T08:12:34-07:00 To process all the files in a folder, I suggest you either use "mogrify" instead of "convert", or use a "for" loop.
Upd.
Did I specify the correct settings for dds?
https://yadi.sk/i/EzJAy9Itc8GROA

1

Code: Select all

C:\ImageMagick\mogrify.exe -format dds -define dds:mipmaps=0 -define dds:compression=a8r8g8b8 C:\Img\*.tga
2

Code: Select all

C:\ImageMagick\mogrify.exe -format dds -define dds:mipmaps=5 -define dds:compression=dxt1 C:\Img\*.tga
3

Code: Select all

C:\ImageMagick\mogrify.exe -format dds -define dds:mipmaps=0 -define dds:compression=dxt1 C:\Img\*.tga
winmisha
Posts: 3
Joined: 2019-04-18T07:20:13-07:00
Authentication code: 1152

Re: How to convert many tga to dds?

Post by winmisha »

This does not work.
C:\ImageMagick\convert.exe -format dds -define dds:mipmaps=0 -define dds:compression=a8r8g8b8 C:\Img\*.tga
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).
Last edited by winmisha on 2019-04-18T09:36:50-07:00, edited 1 time in total.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to convert many tga to dds?

Post by snibgo »

winmasha wrote:This does not work.
Because the command is wrong.

Your "-format dds" would be okay in mogrify, but in convert it sets the format for "info:". So remove that.

Your output file is "C:\Img\*.dds". But that won't do what you want. I suggest you use something like "C:\Img\myfile_%d.dds" which will makes files named myfile_0.dds, myfile_1.dds etc.

But, as I say: I suggest you either use "mogrify" instead of "convert", or use "convert" in a "for" loop.
snibgo's IM pages: im.snibgo.com
Post Reply