TGA Decoder

Started by Neoptolemus, February 22, 2015, 23:11:00

Previous topic - Next topic

Neoptolemus

Hi all,

I've been using the TWL PNGDecoder quite regularly but couldn't find a comparable decoder for TGA images which I use sometimes, so I thought I'd have a go at writing one. I've written it to work in the same way as the PNGDecoder (create a new decoder object with an input stream, then call decode and supply a bytebuffer). You can find it here:

https://github.com/RGreenlees/Java-TGA-Decoder

It supports 24-bit (RGB) and 32-bit (RGBA) formats, and uncompressed or RLE Compressed formats. On my 2.7ghz i7 it took 180ms to decode a 40mb compressed 2988Ãâ€"5312x24 photo and around 80ms to decode a 15mb compressed 2048x2048x32 image. Uncompressed images take around half as long.

Hope someone finds this helpful!