Skip to content

UIImage category to work with WebP image files in iOS.

License

Notifications You must be signed in to change notification settings

Swiftosis/WebP-UIImage

 
 

Repository files navigation

WebP-UIImage

UIImage category to work with WebP image files in iOS.

Installation

Drag and drop the Classes folder and WebP.framework into your project.

Usage

Getting started with WebP-UIImage is simple. Import framework #import "UIImage+WebP.h" and call following methods:

- (NSData *)dataWebPWithQuality:(float)quality;//quality = 0..100
+ (UIImage*)imageWithWebPAtPath:(NSString *)filePath;

+ (UIImage *)imageWithWebPData:(NSData *)imgData;
@property (nonatomic, readonly) NSData *dataWebPLossless;

- (BOOL)writeWebPToDocumentsWithFileName:(NSString *)filename quality:(float)quality;
- (BOOL)writeWebPLosslessToDocumentsWithFileName:(NSString *)filename;

Bonus

I made also an NSValueTransformer subclass called ImageToWebPDataTransformer. You can use it in CoreData to store images with less sizes than jpeg. I use 75 quality value as it is default Google value.

Thanks

The project is heavily based on nyteshade/iOSWebPWithAlphaExample

License

MIT

Tests

No speed/size tests were done. You can make your own and commit it here.

About

UIImage category to work with WebP image files in iOS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 82.8%
  • Objective-C 17.1%
  • Ruby 0.1%