DDS reader doesn't work correctly with alpha channel

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
einstein973

DDS reader doesn't work correctly with alpha channel

Post by einstein973 »

I have a problem converting a DDS image (pedia_icon_core_flora.dds contained in http://www.ec3hp.de/files/dds.zip) to png. I use ImageMagick-6.5.9-10-Q16-windows-dll on Windows Vista like this:
c:\Program Files\ImageMagick-6.5.9-Q16\convert.exe pedia_icon_core_flora.dds pedia_icon_core_flora.png
The result (which shows heavy artifacts) is in the zip archive as pedia_icon_core_flora BAD.png. The same source file converted with ImageMagick 6.5.4-10 on a Linux PC looks okay, the result is named pedia_icon_core_flora OK.png in the zip archive. Other files (without transparency) work perfectly well on both systems.
Steeljaw
Posts: 5
Joined: 2011-03-21T03:09:24-07:00
Authentication code: 8675308
Location: Stockholm, Sweden

Re: DDS reader doesn't work correctly with alpha channel

Post by Steeljaw »

Bumping this since it still doesn't seem to work with IM-6.6.8-5 for windows. I haven't got access to any other OS to try this out atm.

I am looking to extract the alpha layer of a DDS and get a really jaggedy image like this:
Image

If I do the alpha decomposing in GIMP for example I get the following image:
Image

The difference is that I in GIMP tell it not to import the diferent mipmaps, could it be that the DDS-reader in IM grabs all of the mipmaps in the DDS as well? And how can I make it to only read the highest resolution one, if that is the case?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: DDS reader doesn't work correctly with alpha channel

Post by magick »

Post a URL to your image. We need to download and reproduce the problem before we can comment.
Steeljaw
Posts: 5
Joined: 2011-03-21T03:09:24-07:00
Authentication code: 8675308
Location: Stockholm, Sweden

Re: DDS reader doesn't work correctly with alpha channel

Post by Steeljaw »

I am using this DDS,
http://guslin.com/ac4_tex_ngs.dds

I am running the following commands to extract and rearrange the color channels:

convert ac4_tex_ngs.dds -channel ag -separate temp_ngs.png
convert temp_ngs-0.png temp_ngs-1.png -channel gr -combine normal_map.png

It's only the alpha channel that seems affected by the pixelation though, the green channel I also extract is fine!
Steeljaw
Posts: 5
Joined: 2011-03-21T03:09:24-07:00
Authentication code: 8675308
Location: Stockholm, Sweden

Re: DDS reader doesn't work correctly with alpha channel

Post by Steeljaw »

Bump.

Any news in this matter?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: DDS reader doesn't work correctly with alpha channel

Post by fmw42 »

I extracted the alpha channel on IM 6.6.9.6 Q16 Mac OSX Tiger and it looks fine - the same as your GIMP extraction.

convert ac4_tex_ngs.dds -alpha extract ac4_tex_ngs_alpha.png

or

convert ac4_tex_ngs.dds -channel a -separate ac4_tex_ngs.dds_alpha.png

Note that PNG has been under development and improvement over many releases. I suspect that you just need to upgrade your IM or use a different format to save the extracted alpha channel.
Steeljaw
Posts: 5
Joined: 2011-03-21T03:09:24-07:00
Authentication code: 8675308
Location: Stockholm, Sweden

Re: DDS reader doesn't work correctly with alpha channel

Post by Steeljaw »

I'll have to try that on my Mac when I get home.

With the latest available version (6.6.9-7) I still see the artifacts in both 32 and 64bit versions for windows no matter whether I convert to png, jpg or tiff.

The RGB channels are however unaffected by these artifacts.

edit: Just built from svn on ubuntu 11.04 and there are no artifacts to be seen! So this is then a windows build bug?
Post Reply