Skip to content
This repository was archived by the owner on Mar 14, 2020. It is now read-only.

Commit 1d9a201

Browse files
committed
Readme
1 parent d829baf commit 1d9a201

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

README.md

+35-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,36 @@ Uh, so everyone seems to want instagram-style filters for images on iPhone. The
55

66
Inexplicably, there seem to be no photoshop-style interfaces for image processing on iOS. So, I made some. Badly. Please help me fix them. My lomo filter is OK, but could be a lot better. The basics seem to work.
77

8+
It's like photoshop for the UIImage class!
9+
======================
10+
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:
11+
12+
- (UIImage*) levels:(NSInteger)black mid:(NSInteger)mid white:(NSInteger)white
13+
14+
An API just like that cool menu in Photoshop!
15+
16+
The neat part is curves - a popular lomo filter makes extensive use of curves. Want to do a curves adjustment you saw on a blog? Just do this:
17+
18+
NSArray *redPoints = [NSArray arrayWithObjects:
19+
[NSValue valueWithCGPoint:CGPointMake(0, 0)],
20+
[NSValue valueWithCGPoint:CGPointMake(93, 76)],
21+
[NSValue valueWithCGPoint:CGPointMake(232, 226)],
22+
[NSValue valueWithCGPoint:CGPointMake(255, 255)],
23+
nil];
24+
NSArray *bluePoints = [NSArray arrayWithObjects:
25+
[NSValue valueWithCGPoint:CGPointMake(0, 0)],
26+
[NSValue valueWithCGPoint:CGPointMake(57, 59)],
27+
[NSValue valueWithCGPoint:CGPointMake(220, 202)],
28+
[NSValue valueWithCGPoint:CGPointMake(255, 255)],
29+
nil];
30+
UIImage *image = [[[UIImage imageNamed:@"landscape.jpg" applyCurve:redPoints toChannel:CurveChannelRed]
31+
applyCurve:bluePoints toChannel:CurveChannelBlue];
32+
33+
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 for most things.
34+
835
How to integrate
936
======================
10-
Copy and paste the ImageFilter.* classes into your project. It's implemented as categories on UIImage.
37+
Copy and paste the ImageFilter.* and Curves/* classes into your project. It's implemented a Category on UIImage.
1138

1239
How to use
1340
======================
@@ -19,6 +46,12 @@ How to use
1946
// Or
2047
self.imageView.image = [image lomo];
2148

49+
What it looks like
50+
======================
51+
![Screen shot 1](/esilverberg/ios-image-filters/docs/ss1.png)
52+
![Screen shot 2](/esilverberg/ios-image-filters/docs/ss2.png)
53+
54+
2255
What is still broken
2356
======================
2457

@@ -31,6 +64,7 @@ Other options
3164
=============
3265
- Simple Image Processing: http://code.google.com/p/simple-iphone-image-processing/
3366
- GLImageProcessing: http://developer.apple.com/library/ios/#samplecode/GLImageProcessing/Introduction/Intro.html
67+
- CImg: http://cimg.sourceforge.net/reference/group__cimg__tutorial.html
3468

3569
License
3670
=======

docs/ss1.png

137 KB
Loading

docs/ss2.png

71.7 KB
Loading

0 commit comments

Comments
 (0)