Pixelated Result on DDS->PNG Conversion

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
MdCGY
Posts: 6
Joined: 2012-03-25T12:04:23-07:00
Authentication code: 8675308

Pixelated Result on DDS->PNG Conversion

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Pixelated Result on DDS->PNG Conversion

Post 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?
MdCGY
Posts: 6
Joined: 2012-03-25T12:04:23-07:00
Authentication code: 8675308

Re: Pixelated Result on DDS->PNG Conversion

Post by MdCGY »

I'm converting using Windows 7. I tried with the PNG32: prefix and got the same result.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Pixelated Result on DDS->PNG Conversion

Post 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.
MdCGY
Posts: 6
Joined: 2012-03-25T12:04:23-07:00
Authentication code: 8675308

Re: Pixelated Result on DDS->PNG Conversion

Post 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.
Last edited by MdCGY on 2012-03-25T14:07:32-07:00, edited 2 times in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Pixelated Result on DDS->PNG Conversion

Post 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.
MdCGY
Posts: 6
Joined: 2012-03-25T12:04:23-07:00
Authentication code: 8675308

Re: Pixelated Result on DDS->PNG Conversion

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Pixelated Result on DDS->PNG Conversion

Post 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.
MdCGY
Posts: 6
Joined: 2012-03-25T12:04:23-07:00
Authentication code: 8675308

Re: Pixelated Result on DDS->PNG Conversion

Post by MdCGY »

Thanks for the help, I made the bug report: viewtopic.php?f=3&t=20615
Post Reply