0
我想爲我的一個圖片應用程序創建一些很酷的效果。我使用this project來幫助我的過程中不斷變化的曲線,提亮,對比度等更改UIImage曲線時出現大塊顏色?
下面是我使用的代碼:
- (UIImage*)coolifyTheImage {
UIImage *image = self;
NSArray *redPoints = [NSArray arrayWithObjects:
[NSValue valueWithCGPoint:CGPointMake(0, 43)],
[NSValue valueWithCGPoint:CGPointMake(52, 136)],
[NSValue valueWithCGPoint:CGPointMake(107, 201)],
[NSValue valueWithCGPoint:CGPointMake(255, 255)],
nil];
NSArray *greenPoints = [NSArray arrayWithObjects:
[NSValue valueWithCGPoint:CGPointMake(0, 27)],
[NSValue valueWithCGPoint:CGPointMake(54, 86)],
[NSValue valueWithCGPoint:CGPointMake(214, 219)],
[NSValue valueWithCGPoint:CGPointMake(214, 255)],
nil];
NSArray *bluePoints = [NSArray arrayWithObjects:
[NSValue valueWithCGPoint:CGPointMake(0, 86)],
[NSValue valueWithCGPoint:CGPointMake(49, 86)],
[NSValue valueWithCGPoint:CGPointMake(122, 100)],
[NSValue valueWithCGPoint:CGPointMake(201, 167)],
[NSValue valueWithCGPoint:CGPointMake(255, 167)],
nil];
image = [[[image applyCurve:redPoints toChannel:CurveChannelRed]
applyCurve:greenPoints toChannel:CurveChannelGreen]
applyCurve:bluePoints toChannel:CurveChannelBlue];
return image;
}
它精美的作品上的圖像的下半部分,但不頂端。下面是它應該看起來像(從Photoshop採取截圖):
這裏是在Photoshop中的設置:
而這裏的後怎麼弄出來我跑上它的代碼:
在圖片中,有一個巨大的藍色部分,在改變了藍色的曲線後,就是這樣。這是添加曲線的主要功能的問題還是我應該改變點?
請幫忙!
我用黑色/白色漸變替換它,它們看起來確切。那麼,在編碼版本(不是photoshop)最頂端有一條小黑線...... – iosfreak 2012-04-01 00:22:16
好的,那麼在你通過曲線傳遞之前還是之後還有其他什麼?通過曲線的順序是否有影響? – user1118321 2012-04-01 00:24:27
之前沒有任何反應。不,訂單無關緊要。 – iosfreak 2012-04-01 00:30:22