Giter VIP home page Giter VIP logo

iosluban's Introduction

更新.Update

  • 现在可以添加自定义文字 水印 了 | Add custom text as an watermark to your image
  • 对应的调用方法:[UIImage lubanCompressImage:image withMask:maskName]

Luban-iOS

压缩比如下表.Compare:

机型 照片获取途径 原图大小.before 压缩后大小.after
6s 拍照(竖屏) 5.19 Mb 86.8 Kb
6s 拍照(横屏) 5.26 Mb 29.2 Kb
7plus 拍照(竖屏) 8.05 Mb 229.1 Kb
7plus 拍照(横屏) 6.34 Mb 39.6 Kb
6s 截屏 1.05 Mb 53.56 Kb
7plus 截屏 234.7 Kb 37.5 Kb

安装.Install

Via CocoaPods

  • Podfile 文件里添加pod 'Luban_iOS'

    然后在终端运行 pod install

    注意:如果使用 pod search Luban_iOS or pod search Luban-iOS 搜不到,那么,你需要

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

使用.Usage

  • 下载 Demo 试玩一下,看一下输出,点一下图片看压缩后的效果大图

  • 导入 Category 头文件:

    #import <Luban_iOS/UIImage+Luban_iOS_Extension_h.h>

  • 方法调用

    [UIImage lubanCompressImage:image] or

    [UIImage lubanCompressImage:image withMask:maskName] or

    [UIImage lubanCompressImage:image withCustomImage:imageName]

  • 参数说明

/*
 image:    UIImage 对象
 withMask: 添加水印名字 (NSString)
 withCustomImage: 水印图片名称
*/
  • 注意: 想使用自定义文字水印的请使用方法:[UIImage lubanCompressImage:image withMask:maskName] 添加水印时,想使用自定义图片水印的请使用方法:[UIImage lubanCompressImage:image withCustomImage:imageName]

后续添加的功能.Further

  • 可以自定义水印旋转角度
  • 可以根据一个本地路径,进行压缩并存储

iosluban's People

Contributors

guozhiqiang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.