0

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?

Disclaimer: Inspired by this Q from SO.

0

TwelveMonkeys ImageIO

My TwelveMonkeys ImageIO library, can now 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"));
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.