When using imagemagick to apply curves (convert -function
), the output differs from the output when I'm using a curves adjustment layer in Photoshop. What is the reason for this difference?
I'm using 16 bit Tiff images in ProphotoRGB as base files. In Photoshop I create a curves adjustment layer and apply the "Increase Contrast" settings. Then I read the x,y coordinates from the points on the Graph (0,0; 37,16; ...) and converted them to match between 0 and 1, i.e. I divided them by 255.
Next I used im_fx_curves -c
from the imagemagick docs to retreive the coefficients of the function: http://www.imagemagick.org/Usage/color_mods/#curves
Now, in theory, I should get exactly the same image with the function convert -function Polynomial coefficients
as with the curves adjustment layer in Photoshop. However the result quite differs, e.g. the shadows are noticeably brighter. What could be the reason for that? And more important: How could I "correct" this difference to get same results?
One suspect is the color space. Might there be another step because of ProphotoRGB? (Please note, I'm not trying to convert to sRGB at this moment)
Edit: changes as requested following
- The input is ProphotoRGB, the Output is ProphotoRGB, both 16bit, can't see an error here
- The exact command line:
convert "%%G" -function Polynomial "-3.786,5.767,-1.543,0.562,0" "%ConvertTarget%\%%~nG.tif"
- The coordinates in Photoshop: 0,0 38,17 212,231 231,250 255,255
- The coordinates to coefficients conversion:
./im_fx_curves -c 0,0 0.149019607843137,0.0666666666666667 0.831372549019608,0.905882352941176 0.905882352941176,0.980392156862745 1,1 > coefficients.txt
- The histograms:
Before > Photoshop curves > IM Curves