TGA loading using SDL_image

hello all,

I’m loading some TGAs using SDL_image and it seems
like TGAs are BGR format but SDL_image loads them as
RGB. So, mostly red images, appear mostly blue…

(These are all 24 bit (8bits/channel) TGAs)

Any ideas?

cheers,
k.

Sure. Convert the images to a modern format like PNG.
TGA doesn’t have any reason to exist anymore, does it?On Mon, 2005-02-14 at 13:52 +0000, Kostas Kostiadis wrote:

hello all,

I’m loading some TGAs using SDL_image and it seems
like TGAs are BGR format but SDL_image loads them as
RGB. So, mostly red images, appear mostly blue…

(These are all 24 bit (8bits/channel) TGAs)

Any ideas?

hello all,

I’m loading some TGAs using SDL_image and it seems
like TGAs are BGR format but SDL_image loads them as
RGB. So, mostly red images, appear mostly blue…

Does the showimage test program show this problem?
If so, can you post a link to the image?

Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Hello,

Perhaps your TGA files are corrupted. If there is 1 or 2 bytes of garbage at
the beginning of your pixels, the resulting image could appear as if the R
and B componants were inverted (even if it is not the exact transformation
with 2 bytes of garbage : R->B, B->G , G->R )

These images are generated by what? are they correctly loaded by some
independant graphic tool?> like TGAs are BGR format but SDL_image loads them as

RGB. So, mostly red images, appear mostly blue…

(These are all 24 bit (8bits/channel) TGAs)

I’m loading some TGAs using SDL_image and it seems
like TGAs are BGR format but SDL_image loads them as
RGB. So, mostly red images, appear mostly blue…

I’ve seen this recently as well… just thought my app was doing
something silly and we don’t use TGAs for much…

Dave.