Lachlan87
Moderator
USA
160 Posts |
Posted - May 30 2004 : 08:04:56 AM
|
I've been using .tga's for my game, basically for no reason except that they were smaller than .bmp's and had alpha channels. Recently I took a look at how big my graphics folder was and just about choked. Over 40MB and I'm still just starting!!!
Can anyone recommend a better format for games? I need an Alpha Channel and 16 bit color. If possible, I would prefer a format that DirectX 9 can load for me, but that is not a requirement. |
|
Eric Coleman
Gladiator
USA
811 Posts |
Posted - May 30 2004 : 08:40:20 AM
|
You could store your graphics in a compressed archive, and then just extract them when you need to load them in your game. You could also use .png files, which can store alpha information. Do a search on google for libpng. Png files are just regular bmp data compressed with zlib. You could try to create your own format using bzip2, which is free and better at compressing. Go to the Links page and look in the Tools/Libraries/Engines category for the links to both zlib and bzip2 homepages.
|
|
|
VBBR
Moderator
Brazil
617 Posts |
Posted - May 30 2004 : 08:44:12 AM
|
I recommend PNGs also because they are small and free. Also for what Eric said it uses lossless compression, which preserves the image quality.
(I'm in luck here because Revolution3D already loads PNGs for me... )
Also I use BMPs in the development stage because they are easier to edit (MS Paint) and then convert them all to PNGs for final distribution. |
Whatever. Who knows... |
|
|
Sr. Guapo
Swordmaster
USA
272 Posts |
Posted - May 30 2004 : 09:26:57 AM
|
Definately go with PNGs. They are tiny compared with bitmaps and they retain all the image quality. Almost all the major photo editing software supports them (PaintShop, PhotoShop, etc.). D3DX 8 can also load them easily in the CreateTextureFromFileEx call. It is really a great little format... |
Edited by - Sr. Guapo on May 30 2004 09:28:10 AM |
|
|
Lachlan87
Moderator
USA
160 Posts |
Posted - May 30 2004 : 12:01:51 PM
|
Wowza! Pngs are tiny! Thanks guys, thats even better than I had hoped! |
|
|
masterbooda
Swordmaster
277 Posts |
Posted - May 30 2004 : 1:13:16 PM
|
Wow! No kidding I just changed all my .bmps to .png's on a massive game I was working on and saved about 20mbs of room.... That is a great format... why I never thought of it before is beyond me, but I didn't think dx8 supported them...
One question though, can anybody point me to information on extrapulating the alpha channel, that way I can get rid of .dds files too, because they are huge...
DaBooda out... |
DaBooda Team is back: http://dabooda.789mb.com/ |
|
|
Almar
Moderator
Netherlands
192 Posts |
Posted - May 30 2004 : 1:15:19 PM
|
Why don't you use TGA's compress feature? OR change the bitdepth lower if needed. I only need 24/32bit for 3 of my 15 textures, the rest is 16 bit with alpha channel.
TGa without compression zipped is still bigger than TGA with compression compressed as ZIP, I checked it out last week for my own stuff :)
|
|
|
VBBR
Moderator
Brazil
617 Posts |
Posted - May 30 2004 : 1:30:45 PM
|
Are TGAs royalty-free? |
Whatever. Who knows... |
|
|
Sr. Guapo
Swordmaster
USA
272 Posts |
Posted - May 30 2004 : 1:42:53 PM
|
As far as I know... |
|
|
VBBR
Moderator
Brazil
617 Posts |
Posted - May 30 2004 : 2:05:56 PM
|
Great |
Whatever. Who knows... |
|
|
Sr. Guapo
Swordmaster
USA
272 Posts |
Posted - May 30 2004 : 6:58:22 PM
|
Here is a quick comparison. I made a huge (1024X768) image and saved it in all the common image formats. Here are the sizes: BMP: 2305 KB PNG: 50 KB GIF: 30 KB* JPG: 179 KB TGA: 150 KB
* A gif only holds 8 bits (256 colors) per pixel, and I do not(though I am not sure) think it holds alpha information, though this can be determined using the ColorKey value in LoadPictureFromFileEX.
Using that comparison, I think everybody should use gif, if possible, or PNGs. There is no comparison. |
Edited by - Sr. Guapo on May 30 2004 7:02:38 PM |
|
|
Eric Coleman
Gladiator
USA
811 Posts |
Posted - May 30 2004 : 7:03:02 PM
|
I think .TGA files use Huffman encoding, which is part of the .GIF compression scheme, and that means they fall under the same patent. Someone may want to verify it just to be sure. Also, png files can store an alpha channel. I don't know if Directx8 will load the alpha data. |
|
|
Sr. Guapo
Swordmaster
USA
272 Posts |
Posted - May 30 2004 : 7:06:00 PM
|
This is just what I found out in 5 minutes using PSP 7, so I may have messed something up... |
Edited by - Sr. Guapo on May 30 2004 7:48:46 PM |
|
|
VBBR
Moderator
Brazil
617 Posts |
Posted - May 30 2004 : 7:58:40 PM
|
But don't forget Eric, that the GIF patent expired last year (I guess you should know it)... so would it be OK to use TGAs (assuming it falls under the same patent)? |
Whatever. Who knows... |
|
|
Sr. Guapo
Swordmaster
USA
272 Posts |
Posted - May 30 2004 : 8:22:19 PM
|
It is fine to use them, I think, even with the patent, as long as you don't create the same compression algorithm for your own file... I may be wrong, however... The patent just stops everyone from copying the idea and distributing their own version |
|
|
Almar
Moderator
Netherlands
192 Posts |
Posted - May 31 2004 : 03:29:47 AM
|
TGA is supported in DirectX8, so it's not our problem I think :).
Anyway, was the TGA file in it's compressed form? :). and GIF is 256 colors, which won't work out most of the time, JPG should NEVED be used for colorkeyed stuff. And there was something with PNG as well.. :) |
|
|