-deriche

Named for Rachid Deriche, this command filters images employing a recursive method that inexpensively approximates gaussian filters and their derivatives. The command is a basis for -blur_x, -blur_y, -blur_z, -blur_xy, and -blur_xyz and may be used in its own right to generate approximations of a gaussian filter and its first and second derivatives. See -convolve for an overview on filtering images with gaussian and other  kernels.

The format of the command is:

-deriche std_variation>=0[%],order={ 0 | 1 | 2 },... \
...axis={ x | y | z | c },_boundary

This command operates along one dimension only; a sequence of -deriche commands may be used for effects along multiple axes. It is something of a primitive, and frequently occurs as a building block in other G'MIC commands. 

Application: Deriche Desaturation

estella-e.svg reference image gmic estella-e.svg
--apply_channels \"-mul 0.3\",12
gmic estella-e.svg
--deriche[-1] 2,0,c,1

-deriche can filter the spectral axis (c) as well as width (x), height (y) and depth (z) axes. This gives rise to an interesting – though perhaps not rigorously correct – desaturation-like command.

The canonical way to partially desaturate an image is to down scale the saturation channel when the image is represented in an HSV or HSL color space -apply_channels lets us access and scale back saturation fairly quickly. (Note back slashes: These are needed in some command shells (bash, for example) to escape double quotes, so that these characters can reach the G'MIC command interpreter.)   Here, we harness -deriche to blur color channel data. Saturated colors in an RGB color space have at most two channels with high values and (at least) one channel with low values; blurring tends to equalize such inter-channel differences, 'desaturing' color, but not in a manner that preserves luminance. That said, the effect can still be artistically interesting.

Garry Osgood