Adapting Saturation with ImageMagick

In the previous article on Enfuse, the colours are a little dull on the tone mapped output image. So I’ve found a tutorial [1] which apply an intensity of saturation based on the existent saturated/unsaturated pixels.

#tested with ImageMagick 6.6.1-10
convert ${min_ev_name}_tm.tiff -sigmoidal-contrast 2x50% -alpha off ${min_ev_name}_contrast.tiff

convert -set option:modulate:colorspace HSB \( ${min_ev_name}_contrast.tiff -modulate 100,130,100 \) \( -clone 0 \( -clone 0 -modulate 100,0,100 \) -compose difference -composite -auto-level -negate \) -compose CopyOpacity -composite ${min_ev_name}_saturation_mask.tiff

composite ${min_ev_name}_saturation_mask.tiff ${min_ev_name}_contrast.tiff ${min_ev_name}_final.tiff
tone mapping with Enfuse adapting saturation mask 30% adapting saturation

Here is a comparison between a standard 30% saturation and the adapting saturation. The white colour is the full 30% saturation ratio and the gray colour is the area where the adapting technique is applied.
saturation difference

A big thanks to ImageMagick [2] and Meet the Gimp [3] communities for the useful pointers!

[1] Adaptive Saturation
[2] ImageMagick – forum
[3] Meet the Gimp – forum


~ by cedricbompart on June 1, 2010.

%d bloggers like this: