I would like to convert a png image to a tga image with Java. I was looking around the internet but sadly didn't find any Java code examaples. Does anyone have code to do this conversion?
Edit: As this is not a code sharing service: Can anyone point me to an algorithm that describes the conversion of png to tga, as I didn't find any.
I started to recall that the Targa format is relatively simple by today’s standards, so I couldn’t resist putting together a quick implementation:
My implementation is deliberately simplistic. It always writes 32-bit images with no colormap, which is pretty wasteful if the input image has a smaller depth or uses indexed colors. But you will at least get a Targa image out of it.
References: https://en.wikipedia.org/wiki/Truevision_TGA and http://www.paulbourke.net/dataformats/tga/