Photoshop curve tool. Please note that the image here doesn't represent
the current data points that I am using
GPUImage handles these points without problems, however since Imagemagick doesn't support direct input of these values I have to convert each channel points to the curve's expression like this:Red:
0,0
0.1176,0.0196
0.2275,0.098
0.3294,0.3333
0.4392,0.549
0.7451,0.8627
1,1
Green:
0,0
0.0784,0.0196
0.1961,0.2431
0.5176,0.5882
0.7451,0.8039
1,1
Blue:
0,0.2549
0.1569,0.3529
0.3333,0.451
0.8314,0.7255
1,0.8039
Code: Select all
Red: -237.407*u^6 + 634.277*u^5 - 615.934*u^4 + 261.501*u^3 - 44.054*u^2 + 2.617*u
Green: -32.880*u^5 + 80.544*u^4 - 68.222*u^3 + 22.707*u^2 - 1.148*u
Blue: -0.382*u^4 + 0.744*u^3 - 0.498*u^2 + 0.686*u + 0.255
So my process would normally look like this:
Code: Select all
convert test_image.png \
\( -channel Red -fx "`perl im_fx_curves.pl 0,0 0.1176,0.0196 0.2275,0.098 0.3294,0.3333 0.4392,0.549 0.7451,0.8627 1,1`" \) \
\( -channel Green -fx "`perl im_fx_curves.pl 0,0 0.0784,0.0196 0.1961,0.2431 0.5176,0.5882 0.7451,0.8039 1,1`" \) \
\( -channel Blue -fx "`perl im_fx_curves.pl 0,0.2549 0.1569,0.3529 0.3333,0.451 0.8314,0.7255 1,0.8039`" \) result.png
Code: Select all
R: -237.407,634.277,-615.934,261.501,-44.054,2.617,0.000
G: -32.880,80.544,-68.222,22.707,-1.148,-0.000
B: 0.263,0.041,-0.155,-0.155,0.652,0.255
I've already using different options of colorspace but it mostly seem to make it worse.
This is the comparisation between the results where only GPUimage handles my curve points exactly like Photoshop:
Desired result: