Skeep
Skeep

Reputation: 4699

Recreating the curves tool in photoshop with a fragment shader

Im having real trouble recreating the curves tool (aka newb) in photoshop using a fragment shader:

Photoshop Curves Tool

How would I go about creating an S curve like the one above on the blue channel?

Upvotes: 1

Views: 1847

Answers (1)

OpenThread
OpenThread

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

Related Questions