-
Notifications
You must be signed in to change notification settings - Fork 28
Home
Welcome to the Luban_iOS wiki!
Luban_iOS is a library used for compressing image for iOS device. It can quickly compress image with high quality . You can also add watermark for your image .
- Add custom text as an watermark to your image
- corresponding function:
[UIImage lubanCompressImage:image withMask:maskName]
Device | Come From | Before Compressed | After Compressed |
---|---|---|---|
6s | iPhone Camera(Portrait) | 5.19 Mb | 86.8 Kb |
6s | iPhone Camera(Landscape) | 5.26 Mb | 29.2 Kb |
7plus | iPhone Camera(Portrait) | 8.05 Mb | 229.1 Kb |
7plus | iPhone Camera(Landscape) | 6.34 Mb | 39.6 Kb |
6s | Screen Shots | 1.05 Mb | 53.56 Kb |
7plus | Screen Shots | 234.7 Kb | 37.5 Kb |
-
Open your
Podfile
, addpod 'Luban_iOS'
-
Open your terminal and run:
pod install
Attention:If you search for nothing through
pod search Luban_iOS
orpod search Luban-iOS
, then you must do this follow:
pod setup
rm -rf ~/Library/Caches/Cocoapods
Before using the Library , you can download the demo and run the project to have a experience
-
import the Category file:
#import <Luban_iOS/UIImage+Luban_iOS_Extension_h.h>
-
Call The Function Use UIImage :
[UIImage lubanCompressImage:image]
or[UIImage lubanCompressImage:image withMask:maskName]
or[UIImage lubanCompressImage:image withCustomImage:imageName]
-
Parameter Description
image: An object of UIImage, this is the image you want to be compressed withMask: Text of watermark you custom (NSString *) withCustomImage: If you want to use a image you like as the watermark, please provide correct image name
- Add watermark with a custom rotation angle
- Can compress an image object through a local path in your documents an save it at the same path