ios-image-filters

https://github.com/esilverberg/ios-image-filters

photoshop-style filter interface for UIImage class on iOS to make instagram-style images

photoshop-风格的滤镜接口,可以像使用photshop那样子来配置图片。

ios-image-filters

These days everyone seems to want instagram-style filters for images on iPhone. The way to do this (I think) is to examine how people have implemented equivalent filters in Photoshop and code them in objective c. Unfortunately, the imaging libraries are all geared for gaming. For non-game developers who just want simple image processing, this is overkill.

这些日子里,大家都想用具备设置风格的滤镜来处理图片。为了达到这个目的,大家需要研究Photoshop中使用的滤镜以及OC代码中等效的滤镜,很不幸,这些图片滤镜全部都是为游戏开发设计,对于非游戏开发人员,即使只想用最简单的图片处理,这也无异于自杀。

It's like photoshop for the UIImage class!

I've worked hard to mimic the photoshop color adjustment menus. Turns out these are clutch in pretty much all the best image filters you can name right now (lomo, polaroid). For example, if you want to manipulate levels, here's your method, built straight onto the UIImage class:

只是模拟photoshop的颜色平衡的菜单都费了好大的劲。为了调节到能达到指定的效果花了好多好多时间。不过已经很好用了,你可以看如下的例子:

- (UIImage*) levels:(NSInteger)black mid:(NSInteger)mid white:(NSInteger)white

An API just like that cool menu in Photoshop!

Want to do a curves adjustment to mimic a filter you saw on a blog? Just do this:

一个API与Photoshop中的一个菜单非常相似!

能够微调一个滤镜的效果么?用以下的方式即可:

NSArray *redPoints = [NSArray arrayWithObjects:[NSValue valueWithCGPoint:CGPointMake(0, 0)],[NSValue valueWithCGPoint:CGPointMake(93, 76)],[NSValue valueWithCGPoint:CGPointMake(232, 226)],[NSValue valueWithCGPoint:CGPointMake(255, 255)],nil];
NSArray *bluePoints = [NSArray arrayWithObjects:[NSValue valueWithCGPoint:CGPointMake(0, 0)],[NSValue valueWithCGPoint:CGPointMake(57, 59)],[NSValue valueWithCGPoint:CGPointMake(220, 202)],[NSValue valueWithCGPoint:CGPointMake(255, 255)],nil];
UIImage *image = [[[UIImage imageNamed:@"landscape.jpg" applyCurve:redPoints toChannel:CurveChannelRed] applyCurve:bluePoints toChannel:CurveChannelBlue];

The problem with my curves implementation is that I didn't use the same kind of curve algorithm as Photoshop uses. Mainly, because I don't know how, and other than the name of the curve (bicubic) all the posts and documentation I simply don't understand or cannot figure out how to port to iOS. But, the curves I use (catmull-rom) seem close enough.

其实还是有问题的,因为我实现的方式与Photoshop并不一致。主要原因是,我不知道Photoshop的相关滤镜是怎么实现出来的,我只能从iOS的找到类似的效果来替换。

How to integrate

Copy and paste the ImageFilter.* and Curves/* classes into your project. It's implemented a Category on UIImage.

怎么使用呢?复制粘贴ImageFilter.*与Curves.*类到你的项目工程中。他们都是UIImage的category的方式实现的,简单易用。

How to use

#import "ImageFilter.h"
UIImage *image = [UIImage imageNamed:@"landscape.jpg"];
self.imageView.image = [image sharpen];
// Or
self.imageView.image = [image saturate:1.5];
// Or
self.imageView.image = [image lomo];

What is still broken

  • Gaussian blur is slow! 高斯模糊很慢!
  • More blend modes for layers 更多的针对Layer的混合模式
  • Curves are catmull rom, not bicubic ???
  • So much else... 就这些...

Other options

I tried, but mostly failed, to understand these libraries. Simple Image Processing is too simple, and uses a CPP class to accomplish its effects, as does CImg. I find the CPP syntax ghoulish, to say the least. I stared at the GLImageProcessing code for hours, and still don't understand what's going on. Guess I should have taken CS244a...

为了理解这些库怎么用,我试过了,但绝大部分都失败了。简单的图片处理是很简单的,包括用CPP类来实现这些效果,还有CImg。我发现CPP的语法格式太恐怖而放弃了。我尝试了GLImageProcessing几个小时候,因为实在不知道他们是怎么出来效果的-_-!!,也许我该试一下CS244a...

UPDATE: Core image filters in iOS5 are probably what you want to use going forward, though they are not backwards-compatible with iOS4 or earlier.

更新:在iOS5上,Core image滤镜就是你以后要使用的工具了,虽然他们不会向前兼容iOS4之前的版本。

  • Core Image Filters:http://developer.apple.com/library/mac/#documentation/graphicsimaging/reference/CoreImageFilterReference/Reference/reference.html
  • Simple Image Processing: http://code.google.com/p/simple-iphone-image-processing/
  • GLImageProcessing:http://developer.apple.com/library/ios/#samplecode/GLImageProcessing/Introduction/Intro.html
  • CImg: http://cimg.sourceforge.net/reference/group__cimg__tutorial.html

License

MIT License, where applicable. I borrowed code from this project:http://sourceforge.net/projects/curve/files/ , which also indicates it is MIT-licensed.http://en.wikipedia.org/wiki/MIT_License

There is also now code adapted from ImageMagick, whose license may be found at:http://www.imagemagick.org/script/license.php

转载于:https://www.cnblogs.com/YouXianMing/p/4068338.html

[翻译] ios-image-filters相关推荐

  1. 在线识图翻译_拍照翻译ios版下载在线识图翻译-免费拍照翻译软件苹果版下载...

    拍照翻译app在我们的学习中扮演着很重要的角色,当我们遇到看不懂的英文时就可以通过它来帮我们翻译,还不用一个字一个字输入,只要拍照即可快速翻译.这款软件涵盖了各国语言资源,用户可以使用这款软件进行各国 ...

  2. 微软翻译离线简体中文服务器,微软翻译新增离线翻译功能,但使用体验并没有想象中的好...

    你现在的位置: 首页 > Next > 小个性 4月19日,微软翻译iOS版进行了重大升级,正式加入了离线翻译功能.对于经常需要和外文打交道的小伙伴来说,离线翻译可以确保在网络情况欠佳的时 ...

  3. 在React Native和Node.js中验证iOS订阅收据

    交易收据:订阅管理的关键要素 (Transaction receipts: the key element of subscription management) Transaction receip ...

  4. iOS界面设计切图小结

    iOS界面设计切图小结 APR 12TH, 2013 1.基本尺寸 (1)界面 实际设计时按: iPhone4.4s:640px*960px iPhone5: 640px*1136px iPad:15 ...

  5. [月报] 掘金翻译计划月报 — 2018 年 12 月

    前言 划重点:现代 JavaScript 教程翻译完成 ? ? ? 欢迎访问 掘金翻译计划目前翻译完成 1369 篇文章,官方文档及手册 13 个,共有近 1000 名译者贡献翻译和校对,GitHub ...

  6. 手机那点事!已有高人把常见的不常见的坑都给找出来了,我就随便转一下了

    http://www.bubuko.com/infodetail-800056.html mobileTech A useful tools or tips list for mobile web a ...

  7. 二十九、重磅:近1GB的三千万聊天语料供出

    经过半个月的倾力打造,建设好的聊天语料库包含三千多万条简体中文高质量聊天语料,近1G的纯文本数据.此语料库全部基于2万部影视剧字幕,经由爬取.分类.解压.语言识别.编码识别.编码转换.过滤清洗等一系列 ...

  8. 自己动手做聊天机器人 二十九-重磅:近1GB的三千万聊天语料供出

    Reference: http://www.shareditor.com/blogshow/?blogId=112 经过半个月的倾力打造,建设好的聊天语料库包含三千多万条简体中文高质量聊天语料,近1G ...

  9. 高效阅读英语信息的方法

    语言是一个工具,让你了解世界的途径. 随着信息源的不断更新,我的英语信息源占比越来越大. 作为英语险过四级的我来说,阅读英语的文章是有些吃力,为此不得不借助「网页翻译」工具,比如浏览器自带的翻译功能, ...

  10. 老司机告诉你,如何同时运营更新 150 款 App? | 宝宝巴士 CTO 蔡泸炜

    演讲 | 蔡泸炜(宝宝巴士CTO) 活动 | 又拍云 Tech Minds NO.08 福州场 整理 | 西北 又拍云主办的 Tech Minds NO.08 福州场,宝宝巴士 CTO 蔡泸炜作为嘉宾 ...

最新文章

  1. 安装和使用Oracle VM VirtualBox中的要点,注意事项和遇到的问题
  2. 通用权限管理模块系列——需求分析——列举需求
  3. celeron处理器_显卡和处理器哪个更重要?
  4. 【深度学习】面向医学图像的病灶分割调研(三)
  5. AI - 常见算法简介(Common Algorithms)
  6. centos7安装ansible AWX17.1.0
  7. kettle 查询数据库写入文件_怎么连接数据库-详解如何用kettle连接mysql数据库并导出sql查询结果...
  8. python的一个小原理
  9. oracle 10g rac 包root.sh报错,案例:Oracle Rac root.sh报错 Failed to create keys in the OLR
  10. 实例分割的进阶三级跳:从 Mask R-CNN 到 Hybrid Task Cascade
  11. Hausaufgabe--Python 06
  12. Xenapp之web界面中文化及发布应用
  13. 详解卷积神经网络(CNN)在语音识别中的应用
  14. FastJSON 简介及其Map/JSON/String 互转
  15. 计算机兴趣小组活动教学教案,计算机兴趣小组计划教案.doc
  16. Servlet和Servlet容器概念
  17. PDFbox-PDF解析(坐标定位,分页读取)
  18. 离散数学-图的运算与基本概念、导出子图、路与连通
  19. 如何在AI时代验证您的IT职业生涯
  20. IT研发人员的四种工作

热门文章

  1. 数字头盔摄像头是一个智能选项
  2. 超炫的3D特效程序管理功能android
  3. ACS与目录服务器进行用户身份控制管理
  4. 让程序员崩溃的一句话。。。
  5. SpringBoot 一个依赖搞定 session 共享,没有比这更简单的方案了!
  6. IntelliJ IDEA 新版本又来了,修复严重 bug!
  7. 腾讯等技术大佬分享的高可用架构干货,全在这里了
  8. 如何打造高可伸缩的移动电商架构?
  9. 别再透支你的社交信用了
  10. 大部分人最缺的其实是「认知」