I am looking for a small and free TGA image loading class or library for java. Ideally the result is a BufferedImage.
Yes, I have already googled, but most results are outdated, or are quite big libraries that contain a lot of other stuff i dont need. I am looking for something small and simple that reads just TGA images.
Thanks!
Thanks for sharing it!
I've made some changes to improve performance. I'm only doing BGRA 32 Bits file decrypt, but it can help others people.
Just in case anyone is looking for the Android version of this (I had to replace
BufferedImage
withBitmap
).I had uncompressed targa images, so had to tweak example code. Here is my edit it should support uncompressed targa 24bit BGR and 32bit BGRA
I've added a standalone copy of Reality Interactive's ImageIO TGA library here (LGPL):
Just add the the jar file to your classpath and register with ImageIO:
We use this class copied from some open source project to read TGA files. It's really old. It can only handle Targa files with most basic encoding. Give it a try.