alfianlosari / SwiftWebP

Swift WebP Decoder/Encoder for UIImage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SwiftWebP

A Swift WebP Decoder and Encoder for UIKit UIImage.

Features

  • Encode UIImage/PNG data to WebP data.
  • Decode WebP data to UIImage.

Installation

Swift Package Manager

File > Swift Packages > Add Package Dependency Add - Add https://github.com/alfianlosari/SwiftWebP.git

Libraries Used

Usage

Import it

import SwiftWebP

Encode PNG Data

if let webPData = WebPEncoder().encodePNG(data: outputPngData) {
    // use your webP data
}

Encode UIImage

if let webPData = WebPEncoder().encode(image: myUIImage) {
    // use your webP data
}

Decode WebP data

if let images = WebPDecoder().decode(data: webpData) {
    // images type is array [UIImage]
}

About

Swift WebP Decoder/Encoder for UIImage

License:MIT License


Languages

Language:Objective-C 98.9%Language:Swift 1.0%Language:C 0.1%