swift-gif

2.0.0

Cross-platform GIF encoder and decoder for Swift
fwcd/swift-gif

What's New

Version 2.0.0

2023-01-01T22:18:30Z

GIF Coder for Swift

Build

A lightweight LZW encoder and decoder for animated GIFs written in pure Swift, thus running on any platform, including Linux.

Example

// Create a new GIF
var gif = GIF(width: 300, height: 300)

// Add some frames for the animation
for i in 0..<20 {
    let image = try CairoImage(pngFilePath: "frame\(i).png")
    gif.frames.append(.init(image: image, delayTime: 100))
}

// Encode the GIF to a byte buffer
let data = try gif.encoded()

System Dependencies

Description

  • Swift Tools 5.7.0
View More Packages from this Author

Dependencies

Last updated: Wed Apr 03 2024 19:03:13 GMT-0900 (Hawaii-Aleutian Daylight Time)