Any way to BRIGHTEN UIImage without using OpenGL ES?

Does anyone know how to light up UIImage by a certain amount in a simple and effective way? I am currently playing the Apple example GLImageProcessing code example with poor results ... My application currently does not use OpenGLES or EAGLViews and it is awkward to try to overcome this technology.

+2


source to share


2 answers


You can do UIImage in CGBitmapContext . And then you should have a pointer to the raw bytes of the image. At this point, you can do whatever you want with the bytes, including brightening them up. After that, you can create a new CGImageRef from bytes.



This will all be on a CPU, which may not work as well as an OpenGL solution, depending on the image size.

+4


source


It depends on what you mean by "brighter". You can overlay colors easily, and you can probably find a blending method that does what you want. Check out the features CG

and documentation (I would post in more detail, but I can't right now).



+2


source







All Articles