PNG >> DDS Conversion Pixellated
PNG >> DDS Conversion Pixellated
Hi there I'm trying to batch process conversion of PNG to DDS format using ImageMagick but it does not seem to handle fading edges very well.
The PNG image is this:
The result I get is this (PNG > DDS):
Happens with just basic options:
convert.exe -define dds:compression=dxt5
I tried DXT1 (loses alpha), DXT3 and DXT5 both generate the bubble with large blocks. I tried the other 2 DDS options to no avail.
What's also strange is that images fail to open with GIMP using the DDS Plugin with this error message, but images generated with Aorta or The Compressonator can be opened fine. They can however, be opened with Photoshop and the Nvidia DDS Plugin.
I also noticed that ALL programs require generating DDS textures with dimensions that are a multiple of 4, but ImageMagick allows generation of strange resolutions (such as 135x135) which is not valid as DDS. I'm not sure if DDS support is still in its infancy, or are if these are bugs, but I can't help but be saddened by these issues.
The PNG image is this:
The result I get is this (PNG > DDS):
Happens with just basic options:
convert.exe -define dds:compression=dxt5
I tried DXT1 (loses alpha), DXT3 and DXT5 both generate the bubble with large blocks. I tried the other 2 DDS options to no avail.
What's also strange is that images fail to open with GIMP using the DDS Plugin with this error message, but images generated with Aorta or The Compressonator can be opened fine. They can however, be opened with Photoshop and the Nvidia DDS Plugin.
I also noticed that ALL programs require generating DDS textures with dimensions that are a multiple of 4, but ImageMagick allows generation of strange resolutions (such as 135x135) which is not valid as DDS. I'm not sure if DDS support is still in its infancy, or are if these are bugs, but I can't help but be saddened by these issues.
Re: PNG >> DDS Conversion Pixellated
Having the same issue. Have a ton of textures for our game that I'm trying to get into DXT5 on the filesystem. (I'm also converting from png.)
Re: PNG >> DDS Conversion Pixellated
I also can't actually open my dds files with anything -- GIMP and Imdisplay report "unexpected EOF", but they appear to load into our game (albeit with artifacts).
Worth noting that I also tried to convert the PNGs to BMP first (on the off chance that it'd have any effect) -- no dice.
Worth noting that I also tried to convert the PNGs to BMP first (on the off chance that it'd have any effect) -- no dice.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: PNG >> DDS Conversion Pixellated
What version of IM and what platform? Please always provide that information.
There were some recent versions of IM that had trouble processing transparency. That might be the case.
There were some recent versions of IM that had trouble processing transparency. That might be the case.
Re: PNG >> DDS Conversion Pixellated
Does that mean the BMP was the same as the PNG (looking good) or the same as the DDS (blocky)?tastive wrote: Worth noting that I also tried to convert the PNGs to BMP first (on the off chance that it'd have any effect) -- no dice.
Re: PNG >> DDS Conversion Pixellated
Whoops! Sorry to provide such lacking information.
The above happens in 6.9.1-9 Q16 x64, version dated 2015-07-18. I'm on Windows 7.
Going to BMP first did not fix my problem; still had high pixelation in game. (I can only test vs what's in game, since I can't open the DDS files anywhere else due to the EOF error. I'm pretty sure the devs are aware of/have fixed the EOF error for the next version, though, based on this thread.)
(edit: the BMP itself was fine -- no pixelation issues.)
The above happens in 6.9.1-9 Q16 x64, version dated 2015-07-18. I'm on Windows 7.
Going to BMP first did not fix my problem; still had high pixelation in game. (I can only test vs what's in game, since I can't open the DDS files anywhere else due to the EOF error. I'm pretty sure the devs are aware of/have fixed the EOF error for the next version, though, based on this thread.)
(edit: the BMP itself was fine -- no pixelation issues.)
Re: PNG >> DDS Conversion Pixellated
As far as I know it is not disallowed to create dds images with strange resolutions. But mmipmaps dimensions should be a power of two and we protect against that.Bighead wrote:I also noticed that ALL programs require generating DDS textures with dimensions that are a multiple of 4, but ImageMagick allows generation of strange resolutions (such as 135x135) which is not valid as DDS. I'm not sure if DDS support is still in its infancy, or are if these are bugs, but I can't help but be saddened by these issues.
-
- Posts: 24
- Joined: 2016-01-09T10:38:11-07:00
- Authentication code: 1151
Re: PNG >> DDS Conversion Pixellated
ImageMagick 6.9.2-10 Q16 x64 2015-12-20:
Similar to reported here, I observed slightly pixilated/blocky (but still noticeable) results after imagemagick DDS compose or convert operations as simple as "convert tx_sky_rainy1.dds tx_sky_rainy.dds". It's a 4096x4096 game sky texture file that I want to perform various image operations on for in-game "sky diversity". After some reading and experimentation I believe the default compression method is dxt5 with cluster-fit=false. The images I am working on include transparency so I think dxt5 is correct.
Trying "convert tx_sky_rainy1.dds -define dds:cluster-fit=true tx_sky_rainy.dds" improved the quality but there was still noticeable blocky-ness. Trying "convert tx_sky_rainy1.dds -define dds:compression=none tx_sky_rainy.dds" worked as needed. I guess it's not surprising in the end that the compression was causing the pixilation.
Unfortunately with compression=none I am unable to open the file in either paint.net or gimp but it's not totally necessary for my usage so I'm happy for now.
Thanks to imagemagick team for creating and supporting this amazing tool!
Similar to reported here, I observed slightly pixilated/blocky (but still noticeable) results after imagemagick DDS compose or convert operations as simple as "convert tx_sky_rainy1.dds tx_sky_rainy.dds". It's a 4096x4096 game sky texture file that I want to perform various image operations on for in-game "sky diversity". After some reading and experimentation I believe the default compression method is dxt5 with cluster-fit=false. The images I am working on include transparency so I think dxt5 is correct.
Trying "convert tx_sky_rainy1.dds -define dds:cluster-fit=true tx_sky_rainy.dds" improved the quality but there was still noticeable blocky-ness. Trying "convert tx_sky_rainy1.dds -define dds:compression=none tx_sky_rainy.dds" worked as needed. I guess it's not surprising in the end that the compression was causing the pixilation.
Unfortunately with compression=none I am unable to open the file in either paint.net or gimp but it's not totally necessary for my usage so I'm happy for now.
Thanks to imagemagick team for creating and supporting this amazing tool!
Re: PNG >> DDS Conversion Pixellated
I've isolated the problems mentioned here - DXT5 alpha blockiness and DDS files not opening in GIMP, and submitted a patch to fix them.
https://github.com/ImageMagick/ImageMagick/pull/137
https://github.com/ImageMagick/ImageMagick/pull/137
-
- Posts: 24
- Joined: 2016-01-09T10:38:11-07:00
- Authentication code: 1151
Re: PNG >> DDS Conversion Pixellated
Thanks. Much appreciated. In the meantime I found that -define dds:compression=a8r8g8b8 works to preserve detail (no blockiness) while being openable in paint.net.
-
- Posts: 24
- Joined: 2016-01-09T10:38:11-07:00
- Authentication code: 1151
Re: PNG >> DDS Conversion Pixellated
Follow up on this - Hrnchamd's patch released with IM 6.9.3-9 completely fixed the dds compression=dxt5 alpha blocky-ness and compression=none file recognition (with paint.net).
Thank you Hrnchamd!
One note for future reference - cluster-fit=true was required in some of my test cases to avoid alpha blocky-ness; depending on the 4096x4096 image content it could take an additional +10s to +40s computation time compared with -cluster-fit=false. For comparison Nvdia nxcompress and AMD thecompresonator took <2s.
Thank you Hrnchamd!
One note for future reference - cluster-fit=true was required in some of my test cases to avoid alpha blocky-ness; depending on the 4096x4096 image content it could take an additional +10s to +40s computation time compared with -cluster-fit=false. For comparison Nvdia nxcompress and AMD thecompresonator took <2s.