jyi

JYImageTool

🛠 Useful image tools for iOS

Showing:

Popularity

Downloads/wk

0

GitHub Stars

387

Maintenance

Last Commit

4yrs ago

Contributors

2

Package

Dependencies

0

License

MIT

Categories

Readme

JYImageTool

License MIT  CocoaPods  CocoaPods  Support 

Useful image tools for iOS

Features

  • Extract the primary color of the image(Multiple modes)
  • Extract the image pixel color
  • Contrast image is equal (based on pixel rather than image name)
  • QRcode image generation and recognition
  • Image compression

Usage

Extract the primary color of the image

UIColor *whiteColor = [UIColor colorWithRed:1.f green:1.f blue:1.f alpha:1.f];
// extract bright colors and avoid results if close to white color
self.colorArr = [self.imageView.image extractColorsWithMode:JYExtractModeOnlyDistinctColors avoidColor:whiteColor];

Extract the image pixel color

UIColor *color = [self.imageView.image pixelColorAtLocation:point formImageRect:self.imageView.frame];

Contrast image is equal

BOOL isEqual = [self.imageViewOne.image isEqualToImage:self.imageViewTwo.image];
if (isEqual) {
//...Do something..
}
else {
//...Do something..
}

QRcode image generation and recognition

// Create QRcode image
UIImage *QRcodeImage = [UIImage QRCodeImageFromString:@"Job-Yang" imageSize:500];
// Recognition QRcode in the image
NSString *info = [QRcodeImage identifyQRCode];

Image compression

// Compressed to 500KB
NSData *compressData = [self.originalImage compressImageToByte:500 * 1024];

Installation

CocoaPods

  1. Add pod 'JYImageTool' to your Podfile.
  2. Run pod install or pod update.
  3. Import "JYImageTool.h".

Manually

  1. Download all the files in the JYImageTool subdirectory.
  2. Add the source files to your Xcode project.
  3. Import JYImageTool.h.

License

JYImageTool is released under the MIT license. See LICENSE file for details.


中文介绍

实用的iOS图片工具

特性

  • 图片主色提取(包含多种提取模式)
  • 图片像素点颜色提取
  • 图片相同比较(基于图片像素而非图片名)
  • 二维码图片生成与识别
  • 图片压缩

Usage

图片主色提取

UIColor *whiteColor = [UIColor colorWithRed:1.f green:1.f blue:1.f alpha:1.f];
// 提取较附近更亮的主色,并忽略太接近白色的提取结果
self.colorArr = [self.imageView.image extractColorsWithMode:JYExtractModeOnlyDistinctColors avoidColor:whiteColor];

图片像素点颜色提取

UIColor *color = [self.imageView.image pixelColorAtLocation:point formImageRect:self.imageView.frame];

图片相同比较

BOOL isEqual = [self.imageViewOne.image isEqualToImage:self.imageViewTwo.image];
if (isEqual) {
//...Do something..
}
else {
//...Do something..
}

二维码图片生成与识别

// 创建二维码图片
UIImage *QRcodeImage = [UIImage QRCodeImageFromString:@"Job-Yang" imageSize:500];
// 识别图片中的二维码
NSString *info = [QRcodeImage identifyQRCode];

图片压缩

// 压缩到500KB
NSData *compressData = [self.originalImage compressImageToByte:500 * 1024];

安装

CocoaPods

  1. 在 Podfile 中添加 pod 'JYImageTool' .
  2. 执行 pod install 或 pod update.
  3. 导入 "JYImageTool.h".

手动安装

  1. 下载 JYImageTool 文件夹内的所有内容。
  2. 将 JYImageTool 内的源文件添加(拖放)到你的工程。
  3. 导入 JYImageTool.h。

许可证

JYImageTool 使用 MIT 许可证,详情见 LICENSE 文件。

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100