I'm just wondering how can I apply a brightness curve to an image? ...something like that:
I'm bit lost after this step:
Code: Select all
im_fx_curves -c 0,0 0.125,0.375 0.25,0.625 0.5,0.875 1,1
Regards,
Ced.
Code: Select all
im_fx_curves -c 0,0 0.125,0.375 0.25,0.625 0.5,0.875 1,1
Code: Select all
./curves "0,0 12.5,37.5 25,62.5 50,87.5 100,100" image.tiff image_b.tiff
Code: Select all
composite -compose CopyOpacity \( image.tiff -negate \) image_b.tiff mask.tiff
This outputs a set of numbers, which are the coefficients of a polynomial equation that was fitted to the control points you specified. The output of the above program wascedricb wrote:I'm bit lost after this step:Code: Select all
im_fx_curves -c 0,0 0.125,0.375 0.25,0.625 0.5,0.875 1,1
Code: Select all
-0.762,3.333,-5.167,3.595,-0.000
Code: Select all
-0.762 * x^4 + 3.333 * x^3 + -5.167 * x^2 + 3.595 * x + 0
Code: Select all
convert image -function polynomial '-0.762,3.333,-5.167,3.595,-0.000' result
Code: Select all
./curves "0,0 12.5,37.5 25,62.5 50,87.5 100,100" img_orig.tiff img_bright.tiff
composite -compose CopyOpacity img_bright.tiff img_orig.tiff mask.tiff
1) you can get the luminance directly (note the L in HSL in lightness and not luminance)1 - convert the mask.tiff to HSL and extract the luminance channel (I'm fine with this)
2 - apply a threshold value to the luminance image, so for example I'll keep the 20% of the most illuminated pixels and make the rest transparent
3 - replace the pixels from the mask to the transparent pixels from the luminance image (which I've applied the threshold ratio)