Archived

This topic is now archived and is closed to further replies.

Why are TARGA's more useful than .JPG/BMP?

This topic is 4942 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

After converting my images to TARGA, I noticed that NeHe's TGA loader doesn't support grayscale images. Any thoughts on how to get around it? (I would just change my picture to color in GIMP but I'll be danged if I know how)

Oops disregard this post.

[edited by - uber_n00b on May 29, 2004 2:43:47 PM]

Share this post


Link to post
Share on other sites
NeHe''s targa loader doesn''t work with a few of the targa setups, (I think the one that can read compressed doesnt handel the alpha channel right). There are plenty of good ones around the net, or you can check out the one at gametutorials.com

Share this post


Link to post
Share on other sites
code your own loader. actually u just have to do some basic additions to the nehe tga code. its not that hard at all and at wotsite.org or how it was called are the filespecs . good luck

Share this post


Link to post
Share on other sites
PNG is really too flexible of a format for a lone (hobby) programmer to deal with unless they use a really good library.

______________________________________________________________
The Phoenix shall arise from the ashes... ThunderHawk -- ¦þ
MySite
______________________________________________________________

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by Thunder_Hawk
PNG is really too flexible of a format for a lone (hobby) programmer to deal with unless they use a really good library.

<small><font color="00FF00">______________________________________________________________
The Phoenix shall arise from the ashes... ThunderHawk -- ¦þ
<a href="http://snow.prohosting.com/~rico13/">MySite</a>
______________________________________________________________</font></small>


Um... The official libpng is Free software and is easy to use:
http://libpng.org/pub/png/libpng.html

Also, for something even easier, Free Image library makes it super easy to load dozens of file formats:
http://freeimage.sourceforge.net/

It''s a mistake to use TGA just because you think that they are eaiser to load. PNG have much smaller file sizes(with the same quality - PNG is lossless), and also, using an existing library will get you up and going much faster then coding and debugging your own TGA loader.

Share this post


Link to post
Share on other sites
TGAs have an alpha channel (as already mentioned) which is invaluble for at-all-serious graphics work.

In addition, they support run-length encoding, which is very efficient on images that have long stretches of one color (for example, many paletted images and often images with a color key).

BMPs in theory support RLE but it is rarely used, so they tend to be very large. That and they don''t support alpha channel.
JPGs don''t support alpha channel either AND they are "lossy" (ie. you lose some of the information in the compression).

PNGs are fantastic, but the format is about 100x more complex than TGA, so I wouldn''t try writing your own...

Either way D3DX supports all of the above with no work from you AFAIK, so I''d go with PNGs if you can, and otherwise TGAs.

Share this post


Link to post
Share on other sites