I would like to convert a PNG or JPEG image to a TGA image, using Java. Does anyone know a free, open source library that can do this conversion?
Inspired by this Q from SO.
I would like to convert a PNG or JPEG image to a TGA image, using Java. Does anyone know a free, open source library that can do this conversion?
Inspired by this Q from SO.
The TwelveMonkeys ImageIO library can write TGA format, using the standard ImageIO API. It is free, open source software, released under BSD license.
Input can be pretty much any image format supported by an ImageIO plugin, such as JPEG, PNG, TIFF or many more.
Minimal code sample:
public static void main(String[] args) throws IOException {
BufferedImage image = ImageIO.read(new File(args[0]));
ImageIO.write(image, "TGA", new File("foo.tga"));
}
I am the author of the above mentioned library.