1

我在使用片段着色器在 Photoshop 中重新创建曲线工具(又名 newb)时遇到了真正的麻烦:

Photoshop 曲线工具

我将如何在蓝色通道上创建一条像上面的 S 曲线?

4

1 回答 1

3

首先,创建一个曲线方程,请参见以下链接。 http://www.developpez.net/forums/d331608-3/autres-langages/algorithmes/contribuez/image-interpolation-spline-cubique/#post3513925

然后将所有 256 个点保存到一个数组中。下标代表 x,值代表 y。

用新的替换旧的颜色值。

int curvePoints[256];

for (int i = 0; i< image.width * image.height; i++)
{
  image[i].blue = curvePoints[image[i].blue];
}
于 2012-03-12T09:33:51.973 回答