CLD-shaped Brushstrokes in Non-Photorealistic Rendering

Rendering techniques based on a random grid can be improved by adapting brushstrokes to the shape of different areas of the original picture. In this paper, the concept of Coherence Length Diagram is applied to determine the adaptive brushstrokes, in order to simulate an impressionist painting. Some examples are provided to instance the proposed algorithm.


Introduction
Non-photorealistic rendering is focused on developing algorithms for generating or processing images that embody qualities such as the emphasis of certain features, the suppression of details or the use of stylization to suggest specific feelings in the observer. In fact, a wide variety of expressive styles is already existing [1,2,3,4]: among them we can find non-photorealistic rendering styles, inspired by artistic methods such as painting and drawing, useful for digital art. Many rendering techniques simulate the painter's medium, with methods emulating the diffusion of colours through different canvas and paper media to produce watercolour or oil painting effect. Our previous paper [5] describes some non photorealistic rendering algorithms which reproduce different features of impressionist painting. The common framework of such methods consists of two steps: creating a random grid of pixel positions, where to place brushstrokes, and determining the shape and the color of each brushstroke as a function of the color of nearby pixels and of some other parameters. In our previous work the shape was limited to be a circle, a rectangle or a square. The aim of this paper is to shape brushstrokes across the image according to local orientations a painter could manually follow in order to reproduce the texture of the subject. For instance, the upper left area of the picture in fig.1 should be textured with a set of straight vertical strokes, while the lower right area should correspond to angular strokes.
The behaviour of CLD diagrams (see [6], [7], [8]) approximates this requirement, as each pixel position can be associated to a local diagram which reflects both the orientation and the length of the image texture for that point. Such shapes only need to be rescaled and filled with the appropriate RGB color, as in previous algorithms.

CPB Non Photorealistic Rendering
The starting point for CLD shaping of brushstrokes is the simpler Circular Paintbrush (CPB) algorithm, described in [5]: the RGB source image of y x N N × pixels is reppresented by the three-channel brightness function , : For each step k in the sequence , a regularly spaced grid of pixel positions k G is generated as is a random value with a suitable distribution. The random grid k G′ is then computed from k G by adding to each position a displacement in the random grid, a circle of fixed radius r is generated and filled with the solid color given by the color of the corresponding regularly spaced grid pixel in the original image (displaced fill). An alternate solution is using the original color of the same position The previously discussed procedure is iterated several times according to the final desired covering of the canvas. In fact, CPB circles generated at each iterative step can partially or completely overlap. On the other side, some pixels of the output image might not be covered by any circle; in this case, a default color value is assigned, for instance white, the color of the corresponding pixel in the original image or an intermediate value.

The Coherence Length Diagram (CLD)
This section describes a new paint-brush based on CLD image processing. This image analysis method has been discussed in some previous works [7], [8]. Its interesting feature resides in the diagram it generates, which can be regarded as a synthetic way to represent the local texture of the image. Instead of considering the full RGB picture under conversion, the corresponding grayscale image is computed, as CLD is defined on a scalar brightness matrix. So, let us consider and the subscripts 1, 2, 3 correspond to the channels R, G, B. First we compute the average brightness over the whole image which is a function of the distance l . The local CLD, for a given threshold τ , represents the minimum summing distance l such that the corresponding first order moment differs from 0 M by less than τ : This quantity is not defined for all directions of all point: sometimes the edge of the image is reached without entering the desired neighborhood of 0 M . The appearance of a local CLD is represented in fig.2. To see other local behaviour of Coherence Length Diagram, Ref. [6] is quite suitable, as the more general discussion proposed in [7].

Shaping and filling brushstrokes
By connecting all vertices of the CLD in ascending order, a star shaped polygon [9] ) , ( y x P τ is generated, in which the point ) , ( y x belongs to the kernel. With an appropriate scale factor α , such surface can be considered as the brushstroke at the point where the CLD is computed. The above described methods can be used together to obtain an output image containing "well shaped" and "well oriented" brushstrokes, as required at the beginning of this discussion. Instead of generating a set of circles, like in the CPB algorithm, is considered. Clearly, in equations (2) Again, the actual appearance of the output image depends on the sequence of steps k : the latest shapes override the older ones. As stated before, (2) and (3) represent a case with color displacement. The alternate choice would be implemented by filling the generated shapes with the color ) , ( Lower values can be used for 0 d as a conservative measure. , built without and with the displacement filling. Note how the rendering turns out to be different, in particular in depicting the edges of objects. The described CLD paintbrush technique has be organized in a single tool, with the procedures previously discussed in [5]. The package will be proposed in a shortcoming paper devoted to this tool illustration.