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?

Inspired by this Q from SO.

1 Answer 1

1

TwelveMonkeys ImageIO

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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