How to convert DDS with DXT1 to normal file?

Textures, recreate headers, conversions, algorithms and parsing of image files
fuhuan416
Posts: 4
Joined: Wed Jul 13, 2016 9:19 am

How to convert DDS with DXT1 to normal file?

Post by fuhuan416 »

I used below QuickBMS script to convert a file of DDS with DXT3, it can be converted and i will see a normal picture.
But use this script convert DXT1, the image will become a mosaic picture.
I just want to convert DXT1 to a normal picture, any one help me please?
I uploaded a package to the mega.nz, there're 2 files in there, 9700.dds is DXT1, 9728.dds is DXT3, the first one will be mosaic, the second one will be normal converted.
The download key code: !JRS0D7ttupMyzfyP6WgXcYNg22RPGbc9RWguaT6TgvE

set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x0A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x05\x00\x00\x00\x44\x58\x54\x31\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x10\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
endian big
get size long
getdstring null 0xF
get type byte
get width1 byte
get width2 byte
get height1 byte
get height2 byte
if type == 1
putVarChr MEMORY_FILE 0x57 0x33
endif
if type == 0
putVarChr MEMORY_FILE 0x57 0x31
endif
putVarChr MEMORY_FILE 0x11 width1 byte
putVarChr MEMORY_FILE 0x10 width2 byte
putVarChr MEMORY_FILE 0xD height1 byte
putVarChr MEMORY_FILE 0xC height2 byte
get name filename
append
math size - 0x50
log MEMORY_FILE 0x50 SIZE
append
set count size
math count / 2
goto 0x80 MEMORY_FILE
for i = 0 < count
savepos start MEMORY_FILE
endian little
get num short MEMORY_FILE
endian big
putVarChr MEMORY_FILE start num short
next i
endian little
math SIZE += 0x80
log NAME 0 SIZE MEMORY_FILE

Image
Acewell
Posts: 706
Joined: Fri Aug 08, 2014 1:06 am

Re: How to convert DDS with DXT1 to normal file?

Post by Acewell »

can you please attach the samples to your post? :D
TheUkrainianBard
Posts: 121
Joined: Sun May 01, 2016 10:06 pm

Re: How to convert DDS with DXT1 to normal file?

Post by TheUkrainianBard »

Image viewers like XnView or IrfanView+plugin can view valid DDS and save to any [installed/enabled] format.
fuhuan416
Posts: 4
Joined: Wed Jul 13, 2016 9:19 am

Re: How to convert DDS with DXT1 to normal file?

Post by fuhuan416 »

Acewell wrote:can you please attach the samples to your post? :D


Original_and_Converted.rar


Ok, i attached those 2 files in attach.
fuhuan416
Posts: 4
Joined: Wed Jul 13, 2016 9:19 am

Re: How to convert DDS with DXT1 to normal file?

Post by fuhuan416 »

TheUkrainianBard wrote:Image viewers like XnView or IrfanView+plugin can view valid DDS and save to any [installed/enabled] format.


I tried that way before, not usefully, the picture still mosaic, i think the problem maybe should about the script. :mrgreen:
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: How to convert DDS with DXT1 to normal file?

Post by aluigi »

That script has been written by chrrox for IdolM@ster, just in case.
Acewell
Posts: 706
Joined: Fri Aug 08, 2014 1:06 am

Re: How to convert DDS with DXT1 to normal file?

Post by Acewell »

I don't know what the deal is with 9700.dds but even if 9728.dds appears to convert correctly, the image data is shifted 16 bytes too far in both. the converted header should be 128 bytes long and not 144 bytes. maybe your samples are a variant of what was used to write the script and that is why they are having problems :?
fuhuan416
Posts: 4
Joined: Wed Jul 13, 2016 9:19 am

Re: How to convert DDS with DXT1 to normal file?

Post by fuhuan416 »

Acewell wrote:I don't know what the deal is with 9700.dds but even if 9728.dds appears to convert correctly, the image data is shifted 16 bytes too far in both. the converted header should be 128 bytes long and not 144 bytes. maybe your samples are a variant of what was used to write the script and that is why they are having problems :?


Thanks man, you're did your best, like Mr.Admin said that script just for the 'Idlo M@ster', i attached files are 'TEKKEN 6', there two games are developed by NAMCO.
Acewell
Posts: 706
Joined: Fri Aug 08, 2014 1:06 am

Re: How to convert DDS with DXT1 to normal file?

Post by Acewell »

i fixed the bms script to work with your Tekken 6 samples :D
Tekken6_dds.zip


i just added a new type for dxt5 and adjusted the shift to account for the extra 16 bytes


edit
i made a Noesis script to open these dds samples :D
tex_Tekken6_dds.zip