/WebP-Cocoa

An unofficial collection of precompiled WebP binaries for all of Apple's current platforms.

Primary LanguageShellBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

WebP-Cocoa Banner

WebP is a modern image file format that provides amazing lossy and lossless compression fidelity. WebP is developed by Google who very kindly publishes the underlying library, libwepb as open source software.

Google provides precompiled binaries of WebP for both iOS and macOS on WebP's download page. However, at the time of writing, their build pipeline has not yet been updated to support the more modern features of Apple's platforms, such as Swift module support, or architectural slices for Mac Catalyst.

Using Google's original iOS build script as a base, this repository uses GitHub Actions to automatically build and release precompiled WebP binaries for all of Apple's platforms. This includes support for watchOS and tvOS as well as support for Mac Catalyst via Apple's new xcframework format.

There are 4 separate frameworks available for each platform:

  • WebP: Enables both encoding and decoding of WebP image files.
  • WebPDecoder: Enables just the decoding of WebP image files.
  • WebPMux: Enables manipulation of WebP container image features like color profile, metadata, animation.
  • WebPDemux: Enables extraction of image and extended format data from WebP files.

Installation Instructions

  1. Download and extract the package for your platform and capabilities of choice.
  2. Drag the framework folder into your Xcode project.
  3. When prompted, make sure Copy items if needed is checked before proceeding.

Download Frameworks

For fast access, the binaries are bundled up and provided in a variety of different ZIP archive combinations. Simply click any of the links below to begin downloading.

Download All Frameworks for All Platforms (ZIP)
Platform Versions Slices Download Packages
iOS
iPadOS
iOS 9.0 and up.
iPadOS 13.0 and up.
Mac Catalyst 13.0 and up.
  • arm64
  • armv7
  • armv7s
  • x86_64
  • i386
macOS OS X 10.9 and up.
  • x86_64
  • arm64
tvOS tvOS 9.0 and up.
  • arm64
  • x86_64
watchOS watchOS 2.0 and up.
  • arm64_32
  • armv7k
  • i386
  • x86_64

Dependency Managers

If you would prefer to integrate libwebp via a dependency manager, the libwebp-Xcode project managed by SDWebImage already provides amazing support for all of the major dependency managers.

For convenience, the configuration settings for using libwebp-Xcode's packages are as follows:

CocoaPods

pod 'libwebp'

Carthage

github "SDWebImage/libwebp-Xcode"

Swift Package Manager (SPM)

let package = Package(
    dependencies: [
        .package(url: "https://github.com/SDWebImage/libwebp-Xcode", from: "1.1.0")
    ],
    // ...
)

Credits

Repository created and maintained by Tim Oliver. WebP logo artwork by Simo99 used under CC BY-SA 3.0. WebP is developed by Google.

License

All code in this repository is under the BSD-3-Clause License. Please see the LICENSE file for more information.