Warning: this page does not include pictures from the new 1.2 version of ppmhsy!
Ppmhsb enables change of contrast by operating on L in the HSL space. Combined with whitening this leads to quite good results. We compare the output with Gimp (which applies a non-linear contrast transformation on R,G, and B separately) and Imagemagick, which uses a different (unknown) algorithm. The means to change brightness/contrast in the three programs are different, and the changes cannot quite be compared numerically. Instead, the image was tweaked to produce visually similar results.
Contrast was spiffed and brightness was decreased to obtain an
interestingly contrasty flower with a black background. From left to right:
original, gimp (brightness/contrast visually tweaked), imagemagick (brightness
80%, then spiffed 3x), ppmhsy -c 3.5 -v 0.8.
Note: Gimp has the side effect of increasing saturation greatly, the other two
have a much more natural saturation. The whites at the tips of the flower's
petals in ppmhsy look much spiffier though, something that could not be
reproduced by the other two programs by further tweaking.
From left to right: original, gimp, imagemagick, xv, ppmhsy
-c 0.25, ppmhsy -c 0.25 -n 0.2.
Note: This appears to be a very difficult operation! Gimp decreases
saturation, as expected, but also introduces odd black and bright (red)
pixels, which seems to be an artifact of the non-linear transfer function,
which is discontinuous at the darkest and brightest ends (an ordinary defect,
this should be fixed). Imagemagick does a rather bad job. Xv looks good, but
turns grey in the dark areas. If we look at the ppmhsy output, we see patches
of primary colours in the darkest areas appear. This seems to be an effect of
noise amplification of near-black colours (such as red=0, green=1, blue=0,
which is saturated, but very dark, green). This effect can be reduced by
desaturating the darkest colours using the -n switch, resulting in a
good-looking picture (far right). This seems to be what XV is doing also,
though the desaturation filter seems to be a non-continous function, resulting
in a clipping-like effect.
Boris van Schooten, firstname.lastname@example.org