# GUM v.1.0.0

# 32

# Map filters

If you want to bend a text along a curve, you have to use a displacement map. If you want to create 3D effects you use a Bump map, and if you want to make a pattern you map your image to tiles. There are many ways to use maps. All of the Gimp map filters will be discussed here.

## Bump map

Bump map works by embossing an image, and then map it to another image. This will create a 3D effect in the second image, just like if you had modeled your image in clay.

First read about Emboss to understand Azimuth, Evaluation and Depth.

There are many differences between Bump map and the bump map in the Emboss plug-in. First of all, in Emboss bumpmap, you can't specify the bumpmap image you want to "bumpmap with" (picture 2). The Bump map plug-in also has more options. And in this plug-in you can bumpmap any type of image, whereas Emboss only works for RGB images without Alpha.

### Usage

Because you can bumpmap any image, you may have to adjust the position of the background bump map. To do so, use the X and Y offset slides. You may also want to compensate the loss of luminance resulting from embossing, with the Compensate for darkening button. Because Emboss raises light pixels and carves dark pixels, it quite simple to reverse so that otherwise dark and carved parts of your map will turn light and raised. To achieve this, check Invert bumpmap.

The ambient slide controls how much ambient light you want in your image. A high level of ambient light will make all shadows disappear, and the raised and carved parts will be less apparent.

Water level? - what the hack is it? Well, you often use Alpha values or transparent parts in an image. If you use transparency in your map image, those pixels will be treated as dark pixels, and therefore become carved. If you slide the water level up to 255, they will be flattened and turn invisible, just as if you had raised the water level. (If you use Invert bumpmap they will be treated as light pixels, and get raised. Using Water Level will flatten that too. So Water Level can be a water raiser but also a something of a bulldozer).

Linear map, Spherical map and Sinusoidal map can best be described as the tools you use to create your model. Figure 1 shows the relationship between different map modes, and how they raise/carve in relation to light/dark pixels
.

## Coordinate Map

This filter does the same as the Displace filter. The creator of this filter writes that this is easier to use, and maybe he's right, you will have to try it for yourself. There is one limitation though, it will only work with 256x256 pixel images.

Here is how it works: The plug-in will try to map two images, (one in X direction, and one in Y direction) on an original image. The original image will get the architecture from the map images. See pictures and displace plug-in. You can't specify the offset (just as in the Displace filter).

## Displace

This filter is a general distort filter, which can be used for nearly all kinds of distortion. You can for example use it to whirl, pinch, shift, spread or melt your image. We will try to give you a short introduction to the hidden secrets of this filter.

### Description

It is clear that this filter will displace an image or part of an image, the question is how? To put it simple, the Displace filter needs a displacement map to tell it how to distort the image. The brightness or darkness values in this map controls how Displace moves the image pixels. To make displacement easy, always use grayscale images as maps. It will work with colored images too, but as displacement depends on the brightness/darkness of the map, the color information is simply not used.

- Use grayscale images as displacement maps
- The amount of displacement is based on the brightness/darkness of the map

### Calculations

As we know from earlier chapters, you can use 256 shades of gray in a grayscale image. How bright or dark a gray "color" is, depends on the Intensity value, which goes from 1 (black) to 256 (white). In the middle of this range we find "medium gray" with a value of 128.

One of the fundamental parts of displacement is that the "dark values" 0 to 127 will be displaced in one direction, the "medium gray" value 128 will not be displaced at all, and the "light values" 129 to 256 will be displaced in the opposite direction of the "dark values". To make thing easier we can put this range in a new perspective. If you think of -128 as total darkness, and 0 as "medium gray" and +128 as total lightness, it becomes more clear that displacement will go in different directions, since we have negative and positive intensity in our map. The maximum displacement in either direction happens where the map has a value of either (-128) or (+128).

- Displacement is based on a brightness/darkness scale, ranging from -128 to +128
- There will be no displacement where the value is 0
- The displacement goes in two directions. Negative values displace to one direction, and positive to the opposite direction.

### The user interface

Let's take a closer look at the user interface. As you can see, you can displace in both X -and Y directions. You can also set how much you want to displace, and which map you want to use. To make it easy to understand, we will stick with only one direction (X in this case).

The first thing you have to do is create, or open the image to be displaced (We will render a grid system so you can see what's happening).

The second thing you have to do is to make a displacement map. The easiest way to do this is to duplicate your image, because the map must have the same size or proportions as the image you want to displace. Convert the duplicate to Grayscale and clear it.

- The map must have the same proportions as the image or selection that is going to be displaced

### Examples

####
Example 1; basic displacing

- To make it easy; copy, grayscale and clear the image that is going to be displaced, and use that as the base for a map. Now, bring up the Displacement plug-in from the image which is going to be displaced.
- Uncheck "Y" and make sure that "X" is checked and check Black.
- Set the X displacement to 50, and bring up the map image.
- Fill the map with white (+128), choose the name of the map image in the displacement dialog, and press OK. The image has now been displaced 50 pixels to the left (pic. X).
- Now press `Ctrl -Z` and do it again, but this time with a map which is totally black (-128) The image has now been displaced 50 pixels to the right (pic X).
- Let's do this with a map with a value of +64 (a gray with the Intensity value 191). This will displace the image 25 pixels to the left because (64 *50)/128 is 25, which leads to the following algoritm: (value (of gray) * (displacement value))/ 128 equals the amount of displacement. (pic X).

Positive values will displace to the left, and negative to the right. More examples: Gray value: -64 (dark) Displacement value: +50 -> (-64 *50)/128 = -25 -> 25 pixels displacement to the right. Gray value: +64 and Displacement value: -50 -> (64 *-50)/128 = -25 -> 25 pixels displacement to the right.

- If you have positive "X" displacement values, a bright map will displace to the left and a dark to the right
- The amount of displacement is based up on this algoritm: (value *displacement)/128= displacement in pixels, positive to the left and negative to the right.

The above is also true for Y direction displacement, you just have to switch left to top and black to bottom.

- If you have positive "Y" displacement values, a bright map will displace to the top of the image and a dark to the bottom of the image
- The amount of displacement is based on this algoritm: (value*displacement)/128= displacement in pixels, positive to the top and negative to the bottom.

#### Example 2; displacing in two directions

Now we move to more complex displacement. As you see in the dialog box, you can displace in both X and Y direction. This means that you can e.g. displace the image towards the bottom left corner. To achieve this, you have to make two maps, one white and one black. Map the black one to Y and the white one to X. Your image will now be displaced toward the bottom left corner (pic X)
.

#### Example 3 and 4; spreading and curving

We said earlier that you can achieve any kind of distortment with this plug-in, so we will give you two more examples:

Spread horizontal: Create a map made of horizontal black, white and gray stripes. The different intensity in the stripes will make the displaced image look as if you have spread it in horizontal ribbons. You have to experiment by yourself to figure out what you can do, but trust me - you can do a lot with this plug-in.

Curving Text: The obvious thing is to bend text over something circular, e.g a terrestrial globe. To achieve that, you'll have to create a suitable gradient (dark in both ends and light in the middle) with the Gradient Editor. Here we have created a displacement map that will make the text flow around the shape of the car
.

### Tips & Tricks

Here is some additional information. Sometimes it's hard to create the kind of map you want, for example when you only want to displace part of your image. When you experiment with different maps, you'll often want to darken/lighten them, but this will inevitably alter the "medium gray" value. The perfect 0 will be transformed to something which will displace your image. The way to come around this problem is to make the static parts of your map transparent, because fully transparent pixels are considered to have a value of 0. Black pixels which are (almost) transparent are considered to have a value of a bit under 0, or somewhere around (-5). The same goes for semi-transparent white pixels, but they will get a positive value around (+5), so Alpha values should play a very important part in your map making.

### What's the difference between Black, Smear and Wrap?

Say that you're using a white map, a displace value of 50, and that you only want to displace in the X direction. When the image is displaced 50 pixels to the left, there will be 50 pixels missing at the right side of the image. If you check Black, a black color will fill this part for you. If you press Smear, those 50 pixels will be stretched from the right part of the image (pic X). If you press Wrap, the 50 pixels you pushed out of the frame at the left side, will appear at the right side of the image to cover for the missing pixels.

### More calculations

How to calculate where a pixel will end up: Let's choose a pixel which is positioned at 50(x)and 50(y) in the image coordinate system.We go to our maps and check the Intensity value of the equivalent pixel in that position. In this case we presume that the Intensity value we got from map X (the horizontal displacement map), was 230, which means (230 -128)= 102 in the displacement range. Map Y (the vertical displacement map) had an Intensity value of 55, which means (55-128) = (-73) in the displacement range. We also choose a displacement value of 50 for X, and 30 for Y. If we put these values in our algoritm.

- (102*50)/128=39.84 which is the displacement of map X (the pixel will displace 40 pixels to the left)
- (-73*30)/128=-17.11 which is the displacement of map Y (the pixel will displace 17 pixels downwards)

These calculations tell us that our pixel will end up at x=10 and y=67, i.e. the pixel will be moved a bit closer to the bottom left corner.

## Fractal Trace

Fractal Trace distorts your image using a Mandelbrot fractal. It does it in an unusual way by mapping your image to the fractal (see picture). There are five parameters that control the mandelbrot fractal. For a better understanding of the parameters, read about the Mandelbrot Fractal filter in the Render menu. Outside Type lets you choose between four different backgrounds (as in the Displace filter).

## Illusion

Illusion duplicates your image X times, and puts them in a ring around the centre of the original image. The surrounding images are superimposed on the original, so it looks a bit blurry or ghostlike. The only option in this filter is how many (X) copies you want to apply to your image. Another word for this filter is kaleidoscope which is a quite accurate description of what it does.

## Make Seamless

This plug-in prepares an image for tiling by creating seamless edges. This filter does away with all those ugly edges, and it's an easy way to create good-looking patterns.

If you want to create a seamless pattern as a background for your desktop or in a webpage, this is (often) the best tool to use. Note that the centre of the original image will constitute the only focused part of the new image. Mirrors of the original image are placed in the centre and in all four corners of the Seamless image, and those mirrors blend together at the edges, causing it to look a bit blurred or double-exposed in those areas.

If an important part of your image (like a face) is somewhere else than in the middle, you may have to do some correction work by copying parts of the original image, and pasting them into the seamless image. If you feel that the result of this filter is to soft or blurred, try to correct your image with the Offset plug-in in the Image menu.

## Map Object

This filter will map your image to a sphere or a plane. You can also set different lighting effects on the mapping object to make it even more convincing. You can even set how different "materials" will appear in your sphere or plane. This is a very nice plug-in for creating 3D-effects in Gimp. You can for example create a perfect football (soccer, not american). There are of course many more applications for this excellent plug-in, the only limit is your imagination.

### Main interface

In the main interface there is a preview window and a tab folder for Options, Light, Material and Orientation. To look at what you're doing, you must first press the Preview button (there's no auto-preview because that would slow things down).

A hint is to use Show preview wireframe, then your object will preview as a wireframe, and you can follow what you are doing in real time. Whenever you need to take a good look, just press Preview. You can also zoom the preview by pressing + or -.

#### Options

You can choose to map to a plane, or to a sphere. Checking Transparent background results in a transparent surrounding.

Tile Source Image means that the plane or sphere will be repeated or tiled, where it would otherwise end. For example if you map to a plane and this plane is tilted in some direction, there will be a lot of space around the output image. Instead of having this space filled by a background color or transparency, the plane will tile itself where it ends (see pic X).

Create new image preserves the original image, instead it creates a duplicate image where the filter takes effect.

Enable tooltips is a nice option. When you get to know the filter and already know what the tooltips say, you can disable the tooltips messages by unchecking this option.

The Antialiasing option enables you to turn antialiasing on or off, but we recommend to use it, otherwise the images will look very jagged and ugly (there can of course be moments when a non-antialiased image can be useful). Depth refers to the amount of antialiasing, the higher the value, the better the antialiasing, but it will also be conceivably slower. Threshold determines the limit of antialiasing, the process is interrupted when the difference between pixels is lower than the value in the input field.

### Light

You can set the type of light, the light color and the position of the light source, and if you have chosen Directional Light, you can also set the angle of the light source.

Point light is a sort of spotlight which shines straight onto your image.

Directional Light is a softer point light (more like a normal lamp in the ceiling).

To set the color of the light, simply press Lightsource Color.

Position for pointlight: There are three coordinates; X,Y and Z. The X -coordinate moves horizontally from -0.5 to 1.5, where -0.5 is the left-hand position, and 1.5 is the right-hand one. The same goes for Y; -0.5 is at the top and 1.5 is at the bottom. Z is the depth of the light, where 0 would be the flat surface of the computer monitor. There is no upper limit for this coordinate, but if you exceed a value of 5, a little blue dot shows up on the image. You can grab this dot with the cursor and change the position of the light source by dragging (there are no limits for X and Y either - the values are only recommendations from our side).

### Materials

You can control different materials' Intensity and Reflectiveness. The little spheres represent the properties of the material.

Low values makes the "material" look like the left sphere and high values makes it look like the sphere to the right. We have found the following values to be good max/min values:

#### Intensity

- Ambient, which is the amount of the original color to show where no light falls (0.1 -> 3.0), Diffuse: the intensity of the original color where no light falls (0.5 -> 3.0).

#### Reflection

Diffuse: which is the amount of light the dark/soft/plastic parts of the image will reflect. Naturally a dark/plastic part will reflect little light in real life, so don't set this value to high if you want your image to look good. (0.2 -> 0.9) with a nice value around 0.5.

Specular: which is the amount of light the gloss/metallic parts of the image will reflect, (0.4 -> 0.6).

Highlight: this is how much of your image that is considered glossy. Higher values will make the image highlights more focused, and lower values will make it overall lighter, and more unfocused in the highlight parts. (15 -> 50) but around (20 -> 30)is the best.

### Orientation

The best way to understand this folder is to bring up the wireframe preview, and play around. It will take you less than a minute to learn it.

X,Y,Z pos. moves the drawable, just like Offset in the Image menu. The option name stands for the position of the centre of the image.

The default centre value of the X- and Y directions is 0.5.

For the Z-direction, 0 is the centre value (1 is maximal zoom, and negative values is "away from you") there is no limit for the negative scale (but for values under -60 you will probably not see anything).

XY controls the Y rotation around the Z axle, YZ controls the Z rotation around the Y axle and XZ controls the Z rotation around the X axle.

## Paper Tile

Paper Tile makes your image look like it had been cut into small paper tiles, and then put together in a rather sloppy way, so that a variable gap is formed between each paper tile. This filter is easy to use, and there are only a few options. You set the size and shape of the tiles (in pixels) with the width and height slide bars. Slide determines the size of the largest gap (also measured in pixels), and you can choose between a black or white background.

## Small tiles

The function of this filter is the same as in Tile, but it tiles the image within its original size, so the tiled pictures will get smaller.

You can set how many segments/tiles you want with the Segment slide.

You can also flip tiles both vertically and horizontally. You can flip a single tile with Explicit tile, but you have to press Apply to execute the flip. You can also flip every odd tile (counting from the left) with Alternate tiles. If you check All tiles the flip will affect all tiles.

If you have an Alpha channel in your image, you can also set the opacity of your tile.

## Tile

This plug-in tiles your image according to the size you set (the new size must be larger than the old for this to work).

It is wise to check New Image, because this spares the original image. Instead it creates a new, tiled image.

An example may clarify how it works: Say that you have a 287x425 pixel image. If you set the new size to 574x850 you will get four original images in the new image. If you don't make sure that the new image matches the old one, the result may look like the image above.You can choose Constrain Ratio which will make it easier to make "cleanly" tiled images.

Generated by fmtoweb (v. 2.9c) written by Peter G. Martin <peterm@zeta.org.au> Last modified: 19 May 1998