I've an image , I want to change its brightness and I need to save the resultant image obtained from the actual image, how can I do it. I want to increase the brightness using a UIslider?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Get the code from the Github for UIImage
category here.
To brighten the image, write the code as below:
//brighten value can be obtained from slider change event from -255 to 255.
UIImage* brightImage = [originalImage brightenWithValue:sliderValue];
//Convert image into data
NSData *brightImageData = UIImagePNGRepresentation(brightImage);
//Get the path of Documents directory and store the data object to proper file
回答2:
Here's the sample code and explanation about implementing simple image processing filters (Brightness, Contrast, Saturation, Hue rotation, Sharpness) using OpenGL ES1.1. I recommend you this apple's official link here