Reasons for poor gfx when saving as .dds?

Shqype

Shqyptar
Joined
Nov 15, 2005
Messages
2,468
Location
New York + Shqypni
I'm in the middle of creating flags and flag buttons, but I've been running into a problem: whenever I get the image ready, I save it as a DDS file with DXT3 compression (using Gimp). However, when I re-open the image, it gets distorted because for some reason different colors are added usually in square-like patches. For some files it happens, for others it doesn't. Here are before and after pictures:

hungood8zz.png
hunbad7wa.png


Does anyone know what's causing this? How can it be avoided? Must the colors used be basic web-compatible graphics, "safe web colors" or whatever they're called?
 
i had the same problem, i think its the dxt format, when i tried a 16 bit dds version, the colored squares did not appear.
dont know how to fix it with still using dxt3.

but would be interesting to know, cause i went on to use dxt3 without mipmaps for skins, which is quiete effective :P
 
For some images I get this problem, but for others I don't ... hopefully someone is more knowledgeable in this topic so that both you and I can learn the causes of this -- and how to get around it.
 
I don´t really have a clue, cause I use Photoshop to do my buttons and never had this problem, The .dds files look exactly like the .psd ones.

I´d first try using "system - windows" colors (That´s if you got this option in gimp).

Next thing I remember is that I used DDSConverter some time ago (before discovering the Photoshop .dds plugins) and the program always changed the colours and blurred the graphics. So maybe your problem is caused by the software.

I know this is no help at all, but try the thing with the system colours.
 
Do you save your .dds files using DXT3 compression?
 
Try running a lower compression like DXT1. I think those pixels are effects of the compression routines (Fourier transformations with few plane waves) which cannot resolve hard edges very well. Its the same artifacts you sometimes see in jpg graphics with high resolution or on DVD-films that you compressed to CD.
 
Too bad ... DXT3 has better compression and it's what Firaxis uses ... I was hoping to keep the format. Is there any significant change in filesize or quality by using DXT1 (aside from not having the colors added in)?

Thanks for your answer :)
 
Chalid said:
Try running a lower compression like DXT1. I think those pixels are effects of the compression routines (Fourier transformations with few plane waves) which cannot resolve hard edges very well.
I thought image compression in computers was usually done by overlaying several fractal paterns with different properties?
 
In fact there are many different methods to compress images. The method described by you, Fouriere transformations, gauss transformations and so on. But i think to explain Artifacts the mental image of fourier transformations, where different cutoffs represent the different degrees of compression is the easiest to explain artifacts.

The common fact is of course that you loose information the more you cmpress (as long as there is no redundant informaion that can be cut) and that sharp edges will usually show the loss of information most obviosly.
 
Although I don't have a definitive answer, I feel the reason you are having this problem is quite possibly related to gimp. I am using PSP7 and I haven't had this problem before. ;)
 
Agent 009 said:
Although I don't have a definitive answer, I feel the reason you are having this problem is quite possibly related to gimp. I am using PSP7 and I haven't had this problem before. ;)

That´s exactly what I think.
 
After seeing another topic about gimp... the thought crossed my mind that it might have to do with mipmaps. Although this is a highly speculative theory, it could possibly be why you are having this problem.

DTX3 formats can be saved with or without mipmaps, however, it is possible that with gimp, mipmaps are forced. If this is the case for some odd reason, it might explain why you are getting this problem with buttons and not other art files such as city graphics and units. Buttons don't have mipmaps. ;)
 
It's not GIMP's fault, it's the compression. If you're using PSP or PS and haven't seen those you've just been lucky. I had those artifacts appear on some buttons and textures but not on others and I use Photoshop. Like Chalid says it's just the compression - in some cases it just doesn't handle the colors (or more accurately the location where the colors meet, properly. It's possible to "help" the compression a bit by slightly changing the colors in problematic areas but it's not guaranteed to work.

For example I once had two sections yellow and red separated by one line of white pixels. After compression the red would "bleed" onto the yellow, but when I filled that line of white pixels (it was just a separator) with yellow, it eliminated the problem completely.

In the case of the image you posted Shqype, try the following...

Use a slightly different red, better yet use the red which comes out in the DDS.

Double up the black border, i.e. make it two pixels wide. If that's not appropriate for the symbol then instead of making the "second" layer of border black, make it more like dark red, something that won't necessary look like it makes a thicker border but at the same time "helps" the transition as it were.
 
I tried both methods, and both came out even uglier than before. This is what happened after I made the black lines thicker:



It definitely is the compression. I saved as DXT1 compression and got a jumbled image in which the color contrasts even more than before. Similar results with the DXT5 compression. When I choose no compression my image remains perfect.

So, Rabbit, White, do you have any other guidelines for creating images in the future? It's frustrating to spend time putting some graphics together only to find that when you compress them they mess up!
 
Shqype said:
I tried both methods, and both came out even uglier than before. This is what happened after I made the black lines thicker:



It definitely is the compression. I saved as DXT1 compression and got a jumbled image in which the color contrasts even more than before. Similar results with the DXT5 compression. When I choose no compression my image remains perfect.

So, Rabbit, White, do you have any other guidelines for creating images in the future? It's frustrating to spend time putting some graphics together only to find that when you compress them they mess up!
Sorry to hear that. Beyond trying varying shades of the colors, the only other suggestion I have is - don't sweat it. :D Seriously, this image is a button, it's 64x64 pixels, not very big. I know that when you're working on it, then you really notice the flaws but most people will not. Just make it the best you can and let it go - que sera, sera :).
 
Yea, I guess I don't have much of a choice. Thanks again.
 
Back
Top Bottom