Truevision TGA (TARGA) raster graphics support for Swift.
- Swift 5.3
This package provides a Swift interface for the Truevision TGA (TARGA) raster graphics file format.
var image = TGAImage(width: 4, height: 1, color: .white)
// 🎨 Changing the color by pixel
image[0, 0] = .red
image[1, 0] = .green
image[2, 0] = .blue
image[3, 0] = [255, 165, 0]
// 💾 Writing the '.tga' data to disk
let data = image.tgaData()
data.write(to: url)
This library follows the file format specification version 2.0 (January 1991).
# | Description | Support |
---|---|---|
1 | Uncompressed, color-mapped images | ✖️ |
2 | Uncompressed, true-color images | ✅ |
3 | Uncompressed, black and white (unmapped) images | ✖️ |
9 | Run-length encoded, color-mapped images | ✖️ |
10 | Run-length encoded, true-color images | ✖️ |
11 | Run-length encoded, black and white images | ✖️ |
TGAImage is MIT Licensed.