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
macOS
.package(url: "https://github.com/fwcd/swift-gif.git", from: "v3.0.2")

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

GitHub

link
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