Skip to content

hearther/WebPImageSerialization

 
 

Repository files navigation

WebPImageSerialization

WebPImageSerialization encodes and decodes between UIImage and WebP image data, following the API conventions of Foundation's NSJSONSerialization class.

Keen on C functions, are you? Well, WebPImageSerialization provides functions as well, for creating a UIImage from data, and generating a WebP representation of an existing UIImage.

What's that? You'd prefer not to write any additional code? You're in luck! So long as you don't #define WEBP_NO_UIIMAGE_INITIALIZER_SWIZZLING, UIImage will natively support WebP image data, allowing you to treat it no differently than JPEG, GIF, PNG, or TIFF.

Usage

Decoding

UIImageView *imageView = ...;
imageView.image = [UIImage imageNamed:@"image.webp"];

Encoding

NSData *data = UIImageWebPRepresentation(imageView.image);

Contact

Mattt Thompson

License

WebPImageSerialization is available under the MIT license. See the LICENSE file for more info.

About

Complete WebP Support for iOS, with Functions, NSJSONSerialization-style Class, and (Optional) UIImage Swizzling

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 83.7%
  • Objective-C 15.7%
  • Ruby 0.6%