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#
- TGA libraries for C/C++ Open-source C/C++ libraries to read and write TGA (Targa) images: stb_image and ImageMagick's Magick++. Comparison and code examples.
- TGA libraries for C# Open-source .NET libraries to read and write TGA (Targa) images in C#: ImageSharp, Magick.NET and Pfim. Comparison and code examples.
- TGA libraries for Java Open-source Java library to read and write TGA (Targa) images: the TwelveMonkeys ImageIO TGA plugin. Installation and code examples.
- TGA libraries for Go Open-source Go library to read and write TGA (Targa) images: github.com/ftrvxmtrx/tga, a pure Go decoder and encoder for the image package.
- TGA libraries for Python Open-source Python library to read and write TGA (Targa) images: Pillow. How to open, convert and save TGA files with RLE compression.
- TGA libraries for Ruby Open-source Ruby library to read and write TGA (Targa) images: MiniMagick, a wrapper of the ImageMagick command line. Code examples.
- TGA libraries for Rust Open-source Rust crates to read and write TGA (Targa) images: image and tinytga. Comparison and code examples.
- TGA libraries for PHP Open-source PHP extensions to read and write TGA (Targa) images: GD (read only) and Imagick. Comparison and code examples.