Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 1.49 KB

README.md

File metadata and controls

49 lines (33 loc) · 1.49 KB

TGAImage

Truevision TGA (TARGA) raster graphics support for Swift.

Build codecov

Requirements

  • Swift 5.3

About

This package provides a Swift interface for the Truevision TGA (TARGA) raster graphics file format.

Usage

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)

Specification

This library follows the file format specification version 2.0 (January 1991).

Supported Image Types

# 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 ✖️

License

TGAImage is MIT Licensed.