All formats

TGA libraries

Open-source libraries that decode and encode TGA files. TGA is simple, so most general image libraries support it; differences are in which variants they read (palette, 15/16-bit, grayscale), whether they handle the origin bit and the TGA 2.0 footer, and whether they can write RLE.

Language Library Read Write Notes
C/C++ stb_image yes yes single header, public domain; writes RLE by default
C/C++ Magick++ yes yes ImageMagick C++ API, 200+ formats
C# ImageSharp yes yes managed code; Six Labors Split License
C# Magick.NET yes yes ImageMagick for .NET
C# Pfim yes no small, fast TGA and DDS decoder
Java TwelveMonkeys ImageIO yes yes ImageIO plugin, RLE writing
Go ftrvxmtrx/tga yes yes pure Go, works with image; unmaintained but complete
Python Pillow yes yes reads and writes RLE, ID field, orientation
Ruby MiniMagick yes yes wraps the ImageMagick command line
Rust image yes yes pure Rust, many formats
Rust tinytga yes no no_std, no allocation, for embedded-graphics
PHP GD yes no bundled with PHP 7.4+, true-color files only
PHP Imagick yes yes ImageMagick extension

By language#