问题
I have a Mount & Blade: Warband mod called 1257 AD. The mod itself is great, but all the textures have to be resaved to remove mipmaps from dds files, to remove glitches on GNU/Linux. And of course, I could do this manually, but it will took a lot of time(over 2000 textures), and is there any way for gimp to just open and save the file without mipmaps. Also, last time I wanted to do this I used loop with Imagemagicks convert, but it kept mipmaps. So how do I do this kind of convert?
回答1:
You should use the 'define' dds:mipmaps if you don't want to keep the mipmaps. Setting it to zero will disable the writing of mipmaps.
convert input.dds -define dds:mipmaps=0 output.dds
You can find a list of all dds defines here: http://www.imagemagick.org/script/formats.php.
回答2:
If you want to convert them in place, use ImageMagick's mogrify
, which is basically convert
but does things in-place.
Using mogrify
has the potential to irreversibly corrupt your images, so use it wisely and avoid using long strung-out convert
-like command lines (use simple commands).
find . -type f -name "*.DDS" | xargs -L1 -I{} mogrify -define dds:mipmaps=0 "{}"
If you're sure you don't have spaces in your pathnames and you want a bit of a speed increase, then just do
find . -type f -name "*.DDS" | xargs mogrify -define dds:mipmaps=0
来源:https://stackoverflow.com/questions/28242828/batch-convert-dds-file-to-dds-without-mipmaps