Skip to content
cook edited this page Sep 6, 2017 · 2 revisions

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 .

Update

  • Add custom text as an watermark to your image
  • corresponding function:[UIImage lubanCompressImage:image withMask:maskName]

Compare:

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

Install Via CocoaPods

  • Open your Podfile, add pod 'Luban_iOS'

  • Open your terminal and run: pod install

Attention:If you search for nothing through pod search Luban_iOS or pod search Luban-iOS , then you must do this follow:

 pod setup
 rm -rf ~/Library/Caches/Cocoapods

Usage:

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
    

Further

  • 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
Clone this wiki locally