Reputation: 4699
Im having real trouble recreating the curves tool (aka newb) in photoshop using a fragment shader:
How would I go about creating an S curve like the one above on the blue channel?
Upvotes: 1
Views: 1847
Reputation: 2094
At first, create a curve equlation, see the following link. http://www.developpez.net/forums/d331608-3/autres-langages/algorithmes/contribuez/image-interpolation-spline-cubique/#post3513925
Then save all the 256 points into a array. Subscript stands for x,and value stands for y.
Replace old color value with new.
int curvePoints[256];
for (int i = 0; i< image.width * image.height; i++)
{
image[i].blue = curvePoints[image[i].blue];
}
Upvotes: 3