Curves Transforms in PixInsight |
|
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
CurvesTransform implements a set of transfer curves that can be applied to selected channels of images. A transfer curve in PixInsight is an interpolated function applied to each pixel of an image. You define input and output values for a set of arbitrary points. Then for each pixel, the current pixel value is used to interpolate a new value from the set of given points, and the interpolated value replaces the original. Do that for every pixel in an image and you are an instance of CurvesTransform. The previous paragraph basically defines the parameters of CurvesTransform:
Instances of CurvesTransform can be executed on image views and previews. The R, G, and B curves are just applied to the corresponding channels of a color image; nothing original. The combined RGB/K curve is applied to each individual channel of a color image, or to the only channel of a grayscale image; again, no surprises. However, the other three curves, namely the luminance, hue and saturation curves, deserve somewhat detailed discussions. The luminance curve of a CurvesTransform instance, when defined, is applied to the L* channel of the target image in the CIE L*a*b* color space. This works by transforming each pixel from the RGB space to the CIE L*a*b* space on the fly, applying interpolation to the L* value on the luminance curve, and performing the inverse transform back to the RGB space. Color space transformations are calculated in the RGB working space (RGBWS) currently assigned to the image, which can be either a locally defined RGBWS or the global RGBWS.
A hue curve can also be defined in CurvesTransfrom. In this case, each pixel is transformed to the HSV space, the new H value is interpolated, and the inverse HSV->RGB transform is performed. HSV is colorimetrically ignorant, so hue curves must be used with some care to avoid wild luminance/chrominance variations. However, judicious hue curves can be quite useful to adjust individual colors.
The saturation curve, as defined by CurvesTransform, is quite unusual if we compare it to a "normal" color saturation transform. This is because a color saturation transform process (implemented as ColorSaturationTransform in PixInsight Standard) varies color saturation as a function of hue, that is, saturation is changed for some given colors. The saturation curve in CurvesTransform, on the other hand, varies saturation as a function of itself. This is equivalent to something like "increase saturation for unsaturated pixels, but don't touch already saturated ones", instead of "increase saturation for red pixels" in a "normal" saturation transform. The effect of a saturation curve is quite smooth, controllable, and is guaranteed to preserve color balance. The last condition stated in the above paragraph is achieved because saturation transforms in PixInsight are performed in a special, colorimetrically rigorous HSVL* space. For each pixel, two color space transforms are carried out: to the HSV and to the CIE L*a*b* spaces. The S channel is interpolated, and the reverse transform HSV->RGB is performed. This gives us new pixel values with saturated (or unsaturated) chrominance... and a useless, plenty of noise, luminance. Therefore, the new RGB pixel is again transformed to the CIE L*a*b* space, the new luminance is discarded and replaced by the old one, and a final reverse CIE L*a*b* -> RGB transform is done. Of course, all that happens in the RGBWS assigned to the image, either local or global RGBWS.
|