How do I fix inverted colors on TGA sprites?

I've been trying to get this one particular image to show up at the start of a game that I'm trying to port over to the Saturn. I just do what I always do for sprites which is lowering their resolution to 240x240 then exporting them as a .tga on GIMP. Normally this works with lower res versions of the image, but not this one that was ripped from the original Playstation disc. When I compile it in Jo Engine and run it, the colors are inverted. Which, admittedly looks pretty cool, but isn't my goal. Can anyone help me and explain what I'm doing wrong? That would be much appreciated. It has also occurred to me that this may have something to do with the formatting of PSX textures or the program that I used to extract them from the game. Which means if someone can help me with this, it may also apply to other ripped textures as well.
KNMoriginal.png
 
Last edited:
jo engine only supports RGB sprites or 256 color indexed RGB sprites (both in a TGA format). It sounds like you might be using one (or the other) and using the wrong image loader, or you are not setting up the palette in the case of 256 color indexed RGB.

Basically, if you use the right loader and have the palette set up, there's no "inversion" happening. Most likely the sprite format you are using doesn't match the sprite format expected by the jo engine loader you are using.
 
Johannes recommends IrfanView: 8bit Demo Questions · Issue #57 · johannes-fetz/joengine

I recall having issues with GIMP converting to TGA but IrfanView worked. Assuming you are using 24-bit images: TGA, no compression, export bottom left. I believe that should work.
From another thread. I believe that should work. Run file on your images to make sure they are sane:

Code:
/joengine/Samples/demo - 3D/cd$ file *.TGA
BOX.TGA: Targa image data - RGB 64 x 64 x 24
FLR.TGA: Targa image data - RGB 128 x 128 x 24
G.TGA:   Targa image data - RGB 64 x 64 x 24

Notably the color depth.
 
Last edited:
jo engine only supports RGB sprites or 256 color indexed RGB sprites (both in a TGA format). It sounds like you might be using one (or the other) and using the wrong image loader, or you are not setting up the palette in the case of 256 color indexed RGB.

Basically, if you use the right loader and have the palette set up, there's no "inversion" happening. Most likely the sprite format you are using doesn't match the sprite format expected by the jo engine loader you are using.
From another thread. I believe that should work. Run file on your images to make sure they are sane:

Code:
/joengine/Samples/demo - 3D/cd$ file *.TGA
BOX.TGA: Targa image data - RGB 64 x 64 x 24
FLR.TGA: Targa image data - RGB 128 x 128 x 24
G.TGA:   Targa image data - RGB 64 x 64 x 24

Notably the color depth.
Success! Thank you both for the help. I used IrfanView this time for both resizing and converting the image to TGA and IT WORKED! So it's probably something wrong with GIMP. IrfanView even lets me look at bit depth and increase or decrease it if needed. Which I had a hard time finding on GIMP.
 
Last edited:
yeah irfanview is very useful. Also, when you make palleted images for Jo engine, beware it reserves palette index 0. so in practice, you should quantize your colors to 255 max. Jo engine will shift your palette automatically (it's weird, but it works as long as you only use colors 0-254).

GIMP can do it too but it's way more complicated. However, one advantage with GIMP is you can do true 4bpp, which Irfanview can't do. In this case, Jo Engine doesn't support 4bpp either, so you don't need to worry about that.
 
Back
Top