Batch convert DDS file to DDS without mipmaps

主宰稳场 提交于 2020-01-24 00:50:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!