Fill Filter Primitives

These primitives provide some type of Riempimento for the filter region.

Flood

The Riempimento primitive fills the Filter Effects Region with a specified color and opacità. This filter primitive is most useful when combined with other filters primitives.

Flood Filter.
An example of using the Riempimento filter. From left to right: 1. A simple circle. 2. After adding the Riempimento filter with a light blue color. Note that the default Filter Effects Region is larger than the quadro delimitatore of the circle. 3. After the addition of a Composto filter primitive using the In operator. The first input is the output of the Riempimento fitter and the second is the Source Graphic. 4. The Riempimento of the circle has been changed to the Cloth pattern (with the Riempimento e Contorni dialog) and the Composto type has been changed to Arithmetic with K1=0.5, K2=0.0, K3=0.5, and K4=0.0.

Image

Partially Implemented.

The Immagine primitive renders an external graphics file or an internal SVG object. It allows more than one object to be referenced in a complex filter (the first being the object attached to the filter).

Unfortunately, this very useful filter primitive is not yet fully implemented in Inkscape with only external images supported. The GUI will create a reference with an absolute path to the external image. Use the Editor XML to change an absolute path to a relative one if required.

By default, the image is shrunk or stretched to fit inside the quadro delimitatore of the object to which the filter is attached.

Images.
An image applied to two objects with the Immagine filter primitive. The red rectangles show the quadro delimitatore of the objects.

The placement of the image within the quadro delimitatore can be controlled using the parameters x, y, width, and height. The coordinate system is the same as used for the object. The Editor XML must be used to modify these parameters. An additional parameter, preserveAspectRatio, is not supported by Inkscape.

[Nota]Nota

Both Firefox and Opera render the image differently than Inkscape. They use the default Filter Effects Region to determine the image placement (even if set to a different value). They also, by default, preserve the aspect ratio of the image.

Images.
An image applied to two objects with the Immagine filter primitive specifying different image regions. On the left, x is 60 px and width 60 px. On the right, x is -60 px and width 180 px.

Tile

Not implemented.

The Rivestimento primitive fills a rectangular region with a repeated input image.

No options.

Turbulence

The Turbulenza primitive allows the creation of artificial textures such as marble surfaces or clouds. It is based on the work of Ken Perlin who won an Academy Award for creating realistic textures with computers. Perlin solved the problem of using random numbers to produce smooth random fluctuations in color. A simplified version of his method is to generate random intensities at given intervals and then connect these points smoothly together.

Note that both Firefox 3 and Batik render this filter differently. Opera 9.26 renders it the same as Inkscape.

The following figure gives an idea of how the filter would be implemented in one-dimension:

Turbulence: 1D.
A one-dimension illustration of the Perlin method of generating noise. Fractal Noise is shown on the left and Turbulence on the right. The Base Frequency is set to 0.05 giving a «wave length» of 20 pixels (indicated by the vertical dotted lines). The contributions from three Octaves are shown individually and then summed.

The RGB and Alpha components are each derived separately.

Turbulence: Components.
The components of a Fractal NoiseTurbulenza filter. From left to right: Red. Green. Blue. Alpha. Combined, there is a black rectangle behind the right half. The Matrice di Colore primitive was used to extract the individual components.

The Type can either be Fractal Noise or Turbulence. Turbulence tends to have more dramatic dark regions as the absolute values of the noise terms are used, creating «visual cusps».[14]

Turbulence: Types.
The two types of noise available: Left: Fractal Noise. Right: Turbulence. Top: Only red channel. Bottom: All channels. There are black rectangles behind the right halves.

The Base Frequency is defined by default in terms of inverse Pixel schermo. For example, a frequency of 0.1 would have a «wave length» of 10 pixels. Inkscape cannot yet create resolution independent noise. Reasonable values for this attribute range from 0.01 (a slowly varying texture) to 0.2 (a rapidly varying texture).

Turbulence: Base Frequency.
Fractal Noise as a function of Base Frequency. From left to right: 0.05. 0.10. 0.20. Top: Only red channel. Bottom: All channels, a black rectangle has been placed behind the right halves.

The number of Octaves determines the complexity of the noise, the more Octaves, the more complex. Each Octave adds a term with twice the Frequency but half the amplitude. Using more than four or five Octaves isn't so useful as the spatial and color variations become too small to be seen (and increases the CPU load).

Turbulence: Octaves.
Fractal Noise as a function of Octaves. All with Base Frequency of 0.05. From left to right: 1 octave. 2 octaves. 3 octaves. Top: Only red channel. Bottom: All channels, a black rectangle has been placed behind the right halves.

The Turbulenza primitive uses a pseudo-random number generator. In principle, renderings with different SVG viewers should use the same generator and produce the same textures (at the same scale). If you use the filter twice on two identical objects, the textures should be the same. Changing the seed will force the random-number sequence to be different and thus the textures will be different too.



[14] See http://www.noisemachine.com/talk1/22.html.