I want to adjust an image like curves tool in photoshop. It changes image color, constrast, etc in each R,G,B channel or all RGB.
any idea to do this task in objective C?
I found this link http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=68577&lngWId=-1 but it only adjust curves in all image using VB, not support each color channel like photoshop
The way the curves work in Photoshop use histogramming methods. Essentially one grabs the histogram by counting the amount of each value (the values that can be assigned are on the X axis of the histo) there are throughout the whole image. One can perform this operation to gain the histogram for each color channel.
Look here for image histogramming
http://en.wikipedia.org/wiki/Image_histogram
After one has the histogram, a curve can be applied (to each color channel if you like). The standard curve is a one-2-one or linear curve. What this means is when the actual pixel value is a 10, the value assigned to your edited image is a 10.
One could imagine any curve or even a random distribution. While there are many methods a standard method is log based histogram methods. What this does is essentially looks at the image histogram, and applies the greatest transform curve slopes to the histogram areas with the highest input pixel counts thus providing good contrast for the most amount of pixels.
In terms of a curve, the curve you place on top of the histogram simply defines the mapping function of input pixel value to edited pixel value. You can apply a curve without doing a histogram, but the histo is a good reference for your user so that they know where they want to edit the curve for best effect.