Swiftpack.co - fwcd/swift-gif as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by fwcd.
fwcd/swift-gif v3.0.2
Cross-platform GIF encoder and decoder for Swift
⭐️ 15
🕓 2 weeks ago
.package(url: "https://github.com/fwcd/swift-gif.git", from: "v3.0.2")

GIF Coder for Swift


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


// 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


Stars: 15
Last commit: 2 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics