PDA

View Full Version : targa image files



Nick's a Novice
12-05-2005, 10:55 AM
Hi, I have a question about targa image files. I am creating a very simple targa image to be displayed it has an alpha layer and a color layer. I am using paint shop pro 8 to create the targa file but apparently there are different types of targa image files, cus the code I found on the net for loading in targas for opengl to use only loads targa type 2 and targa type 10. I'm not sure how to create a targa of either of these types using Paint Shop Pro, cus the ones it is currently creating are of a different type. so I guess my question is this:

a.) can I create a targa of type 2 or 10 using psp 8, if so how?

b.) if not is there another program that anyone can recomend for creating targa images of this type?

c.) if not does anyone have code for loading a targa file of other types into a texture for OpenGL?

12-05-2005, 11:53 AM
The 2 main different TGA foramts are the 'normal' and 'compressed' ones. I guess the code you have to load TGA does not handle compression.

Nick's a Novice
12-05-2005, 12:34 PM
I have found information on several types of targa files:
0 - No image data included.
1 - Uncompressed, color-mapped images.
2 - Uncompressed, RGB images.
3 - Uncompressed, black and white images.
9 - Runlength encoded color-mapped images.
10 - Runlength encoded RGB images.
11 - Compressed, black and white images.
32 - Compressed color-mapped data, using Huffman, Delta, and
runlength encoding.
33 - Compressed color-mapped data, using Huffman, Delta, and
runlength encoding. 4-pass quadtree-type process.

I can generate compressed or uncompressed targa files with psp I have tried both and neither is of type 2 or 10 which is what my code loads, I will look and see what type is being genereated by psp and add it to the post later tonight. If anyone has any Idea how to generate a 2 or 10 type let me know.

12-05-2005, 04:52 PM
the targa files being produced by ps are type 1. If anyone knows how to make them type 2 or has the code to load the type 1 files that would be great!

uruk
12-06-2005, 04:29 AM
Ummm... Try to set the color depth of your image to 24 bpp (16.7 mil. colors).

Nick's a Novice
12-06-2005, 07:07 AM
I have it set to this, and no luck. Still creating targa files of type 1...

Nick's a Novice
12-08-2005, 06:17 AM
I got it to work, For some reason I had to open it and save the files I made in psp in photoshop and this saved them as type 2.