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.
- Download and extract the package for your platform and capabilities of choice.
- Drag the
framework
folder into your Xcode project. - When prompted, make sure Copy items if needed is checked before proceeding.
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. |
|
|
macOS | OS X 10.9 and up. |
|
|
tvOS | tvOS 9.0 and up. |
|
|
watchOS | watchOS 2.0 and up. |
|
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:
pod 'libwebp'
github "SDWebImage/libwebp-Xcode"
let package = Package(
dependencies: [
.package(url: "https://github.com/SDWebImage/libwebp-Xcode", from: "1.1.0")
],
// ...
)
Repository created and maintained by Tim Oliver. WebP logo artwork by Simo99 used under CC BY-SA 3.0. WebP is developed by Google.
All code in this repository is under the BSD-3-Clause License. Please see the LICENSE file for more information.