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 v2.1.0
Cross-platform GIF encoder and decoder for Swift
⭐️ 14
🕓 32 weeks ago
.package(url: "https://github.com/fwcd/swift-gif.git", from: "v2.1.0")

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: 14
Last commit: 5 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Version 2.0.0
39 weeks ago

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