Page 1 of 1

Pixelated Result on DDS->PNG Conversion

Posted: 2012-03-25T12:09:58-07:00
by MdCGY
Source image (DDS): http://www.sendspace.com/file/wcp210
Result: http://i.imgur.com/q20QA.png
Desired Result: http://i.imgur.com/4Cvzf.png

IM Version: ImageMagick 6.7.6-0 2012-03-05 Q16

Does anyone know how I can fix this? The result I'm getting is extremely pixelated compared to the desired result (which I generated using an online dds->png conversion tool). I'm using a basic convert command (convert inputfile.dds outputfile.png) and I'm at my wit's end with it.

Re: Pixelated Result on DDS->PNG Conversion

Posted: 2012-03-25T13:31:42-07:00
by fmw42
This works just fine for me on IM 6.7.6.1 Q16 Mac OSX Snow Leopard with libpng 1.4.9

convert 2DInventoryDaggers.dds 2DInventoryDaggers.png

No pixelation. It would appear that in your conversion the alpha channel was made binary

You might try again with

convert 2DInventoryDaggers.dds PNG32:2DInventoryDaggers.png

and see if that makes a difference.

What platform are you using? Perhaps you need to upgrade your libpng?

Re: Pixelated Result on DDS->PNG Conversion

Posted: 2012-03-25T13:54:15-07:00
by MdCGY
I'm converting using Windows 7. I tried with the PNG32: prefix and got the same result.

Re: Pixelated Result on DDS->PNG Conversion

Posted: 2012-03-25T13:58:18-07:00
by fmw42
Perhaps a Window IM issue. Can you check your version of libpng? I am not a Windows user, so cannot tell you how. Perhaps the PNG developer will be able to respond or some other windows user might test it. Otherwise, you could re-post this on the Bugs forum and link it back to your post here.

Re: Pixelated Result on DDS->PNG Conversion

Posted: 2012-03-25T14:04:29-07:00
by MdCGY
Yeah not sure how to do that, Google-fu hasn't produced any version checking help thusfar (though still looking).

I just tested a conversion to gif and it looks similarly fangled, a conversion to jpg produces the proper result but without any transparency obviously.

Re: Pixelated Result on DDS->PNG Conversion

Posted: 2012-03-25T14:06:22-07:00
by fmw42
gif only supports binary transparency, so that is not surprising. try converting to tif, though you may get the same result. But that will tell if it is a DDS decode or a PNG encode problem.

Re: Pixelated Result on DDS->PNG Conversion

Posted: 2012-03-25T14:07:44-07:00
by MdCGY
Looking at the DDS in a hex editor it looks like it's DXT5, I tried a DXT3 dds format and it converts properly.

Edit: TIF looks the same as png.

Re: Pixelated Result on DDS->PNG Conversion

Posted: 2012-03-25T14:10:25-07:00
by fmw42
Sorry I don't understand DDS formats. But glad you found a way to handle it. Not sure why it works on unix but not windows, though. So you might still post a bug report.

Re: Pixelated Result on DDS->PNG Conversion

Posted: 2012-03-25T14:14:32-07:00
by MdCGY
Thanks for the help, I made the bug report: viewtopic.php?f=3&t=20615