Når den nye mønsterpenselen er ferdig, blir han vist i biletvindauget. Du kan då lagra han i .gih
-format ved å velje → i biletmenyen. Gi penselen filutvidinga .gih
og trykk knappen . Du vil då få opp følgjande vindauge:
Figur 7.18. The dialog to describe the animated brush
Dette vindauget dukkar opp når du lagrar eit bilete som mønsterpensel
Ved hjelp av denne tilsynelatande litt uforståelege dialogen, kan du bestemma ein del av animasjonseigenskapane til penselen.
“Spacing” is the distance between consecutive brush marks when you trace out a brushstroke with the pointer. You must consider drawing with a brush, whatever the paint tool, like stamping. If Spacing is low, stamps will be very close and stroke look continuous. If spacing is high, stamps will be separated: that's interesting with a color brush (like “green pepper” for instance). Value varies from 1 to 200 and this percentage refers to brush “diameter”: 100% is one diameter.
Dette er det penselnamnet som kjem opp i penselmenyen.
Dette er storleiken på cellene du vil dele opp i lag. Utgangspunktet er ei celle per lag, med same storleik som laget. Det er altså bare ein pensel i kvart lag.
Det er mogleg å ha eitt stort lag og dele dette opp i dei cellene som blir brukte for dei ulike figurane i mønsterpenselen.
For eksempel, dersom vi ønskjer ein pensel på 100 × 100 pikslar med 8 ulike enkeltbilete, kan vi ta desse 8 enkeltbileta frå eit lag på 400 x 200 pikslar eller frå eit lag på 300 × 300 pikslar, men då med ei ubrukt celle.
Dette er kor mange celler, ei for kvart enkeltbilete, som blir tatt ut frå kvart lag. Førehandsinnstillinga er lagtalet, sidan det er bare eitt bilete per lag.
This tells how cells have been arranged in layers. If, for example,
you have placed height cells at the rate of two cells per layer on
four layers, GIMP will display:
1 rows of 2 columns on each layer
.
Dette er ikkje heilt ukomplisert, så det kan kanskje vere nødvendig med ei forklaring på korleis ein skal arrangere celler og lag.
GIMP starts retrieving cells from each layer and stacks them into a
FIFO stack (First In First Out: the first in is at the top of the
stack and so can be first out). In our example 4 layers with 2 cells
in each, we'll have, from top to bottom: first cell of first layer,
second cell of first layer, first cell of second layer, second cell
of second layer..., second cell of fourth layer. With one cell per
layer or with several cells per layer, result is the same. You can
see this stack in the Layer Dialog of the resulting
.gih
image file.
Når dette er gjort, lager GIMP ein tabell med Dimensjonen du har sett for biletet. Ein slik tabell kan ha opp til fire dimensjonar.
In computer science an array has a “myarray(x,y,z)” form for a 3 dimensions array (3D). It's easy to imagine a 2D array: on a paper it's an array with rows and columns
With a 3d array we don't talk rows and columns but Dimensions and Ranks. The first dimension is along x axis, the second dimension along y axis, the third along z axis. Each dimension has ranks of cells.
GIMP byrjar med å henta celler frå toppen av stabelen. Først alle på høgresida av gruppa, deretter dei på venstre sida. Dersom du har vore borte i programmering, hugsar du kanskje at tabell(4,2,2) blir fylt opp, eller tømt, slik: (1,1,1), (1,1,2), (1,2,1), (1,2,2), (2,1,1), (2,1,2), (2,2,2), (3,1,1).... (4,2,2). Du vil sjå eksempel på dette seinare.
Besides the rank number that you can give to each dimension, you can also give them a Selection mode. You have several modes that will be applied when drawing:
GIMP selects a rank from the concerned dimension according to the order ranks have in that dimension.
GIMP selects a rank at random from the concerned dimension.
GIMP selects a rank in the concerned dimension according to the moving angle of the brush.
The first rank is for the direction 0°, upwards. The other ranks are affected, clockwise, to an angle whose value is 360/number of ranks. So, with 4 ranks in the concerned dimension, the angle will move 90° clockwise for each direction change: second rank will be affected to 90° (rightwards), third rank to 180° (downwards) and fourth rank to 270° (-90°) (leftwards).[2]
These options are for sophisticated drawing tablets.
Eksempel
Kva kan alt dette brukast til? Vi vil vise dette gjennom ei eksempelrekke. I kvar dimensjon kan du gi penslane dine bestemte eigenskapar som fører til bestemte resultat.
Let us start with a 1D brush which will allow us to study selection modes action. We can imagine it like this:
Follow these steps:
Open a new 30x30 pixels image, RGB with Transparent fill type. Using the Text tool create 4 layers “1”, “2”, “3”, “4”. Delete the “background” layer.
Save this image first with
.xcf
extension to keep
its properties then save it as
.gih
.
The Save As Dialog is opened: select a destination for your image. OK. The GIH dialog is opened: Choose Spacing 100, give a name in Description box, 30x30 for Cell Size, 1 dimension, 4 ranks and choose “Incremental” in Selection box. OK.
You may have difficulties to save directly in the GIMP Brush
directory. In that case, save the
.gih
file manually into
the /usr/share/gimp/gimp/2.0/brushes
directory. Then come back into the Toolbox, click in the brush
icon to open the Brush Dialog then click on
. Your new brush appears in the
Brush window. Select it. Select pencil tool for instance and
click and hold with it on a new image:
You see 1, 2, 3, 4 digits following one another in order.
Take your .xcf
image file
back and save it as .gih
setting Selection to “Random”:
Digits will be displayed at random order.
Now select “Angular” Selection:
I denne tredimensjonale mønsterpenselen vil avtrykket variera etter kva retning penselstroket går. Avtrykket vil alternere regelmessig mellom høgre og venstre, medan fargen vil skifte tilfeldig mellom svart og blå.
The first question we have to answer to is the number of images that is necessary. We reserve the first dimension (x) to the brush direction (4 directions). The second dimension (y) is for Left/Right alternation and the third dimension (z) for color variation. Such a brush is represented in a 3D array “myarray(4,2,2)”:
There are 4 ranks in first dimension (x), 2 ranks in second dimension (y) and 2 ranks in third dimension (z). We see that there are 4x2x2 = 16 cells. We need 16 images.
Creating images of dimension 1 (x)
Open a new 30x30 pixels image, RGB with Transparent Fill Type.
Using the zoom draw a left hand with fingers upwards.[3]
Save it as handL0k.xcf
(hand Left 0°
Black).
Opna Lagmenyen. Dobbeltklikk på laget for å opna Lagdialogboksen og endra namnet på laget til handV0s.
Duplicate the layer. Let visible only the duplicated layer, select it and apply a 90° rotation (Layer/Transform/ 90° rotation clockwise). Rename it to handL90k.
Repeat the same operations to create handL180k and handL-90k (or handL270k).
Creating images of dimension 2 (y)
This dimension in our example has two ranks, one for left hand and the other for right hand. The left hand rank exists yet. We shall build right hand images by flipping it horizontally.
Kopier handV0s-laget. La bare kopien vere synleg og marker denne. Endre namnet til “handH0s”. Gå til Lag -> Omform -> Bytt horisontalt.
Repeter dette på det andre venstrelaget for å laga høgreekvivalenten.
Re-order layers to have a clockwise rotation from top to bottom, alternating Left and Right: handL0k, handR0k, handL90k, handR90k, ..., handR-90k.
Creating images of dimension 3 (z)
Lage bilete til dimensjon 3 (z):: Også den tredje dimensjonen har to område, eit for svart og eit for blå farge. Det første området, svart, har vi alt. Bileta i dimensjon 3 er kopi av bileta i dimensjon 2, men i blåfarge. Dermed har vi dei 16 bileta vi treng. Problemet er at det er vanskeleg å handtera ei rad med 16 lag. Vi bruker derfor lag med to bilete i kvart lag.
Marker handV0s-laget og la bare dette laget vere synleg. Bruk Bilet -> Storleik på lerretet og endre teikneflata til 60 × 30 piksel.
Kopier handV0s-laget. Bruk Fyll-verktøyet og fyll handa på kopien med blåfarge.
Now, select the Move tool. Double click on it to accede to its properties: check Move the Current Layer option. Move the blue hand into the right part of the layer precisely with the help of .
Make sure only handL0k and its blue copy are visible. Right click on the Layer Dialog: Apply the Expand as Necessary. You get a 60x30 pixels layer with the black hand on the left and the blue hand on the right. Rename it to “handsL0”.
command with the optionGjer det same med dei andre laga.
Set layers in order
Layers must be set in order so that GIMP can find the required image at some point of using the brush. Our layers are yet in order but we must understand more generally how to have them in order.There are two ways to imagine this setting in order. The first method is mathematical: GIMP divides the 16 layers first by 4; that gives 4 groups of 4 layers for the first dimension. Each group represents a direction of the brush. Then, it divides each group by 2; that gives 8 groups of 2 layers for the second dimension: each group represents a L/R alternation. Then another division by 2 for the third dimension to represent a color at random between black and blue.
Du kan sjå på sorteringa på to måtar. Den eine er reint matematisk: GIMP dividerer dei 16 laga med 4 og får 4 grupper med 4 lag til den første dimensjonen. Kvar gruppe representerer ei retning på penselen. Deretter blir kvar gruppe dividert med 2. Dette gir 8 grupper med 2 lag til den andre dimensjonen, altså alterneringa høgre/venstre. Den andre divisjonen med 2 gir den tilfeldige skiftinga mellom svart eller blå.
How will GIMP read this array?: GIMP starts with the first dimension which is programmed for “angular”, for instance 90°. In this 90° rank, in yellow, in the second dimension, it selects a L/R alternation, in an “incremental” way. Then, in the third dimension, in a random way, it chooses a color. Finely, our layers must be in the following order:
Voilà. Your brush is ready. Save it as
.xcf
first, then as
.gih
with the following
parameters:
Spacing: 100
Description: Hands
Cell Size: 30x30
Number of cells: 16
Dimensions: 3
Dimensjon 1: Rangering: 4 Val: Angular
Dimensjon 2: Rangering: 2 Val:: Incremental
Dimensjon 3: Rangering: 2 Val:: Random
Place your .gih
file into
GIMP brush directory and refresh the brush
box. You can now use your brush.
Figur 7.19. Her er penselen brukt for å streke opp eit elliptisk utval:
This brush alternates right hand and left hand regularly, black and blue color at random, direction according to four brush directions.
[2] For previous GIMP versions you may have to replace “clockwise” with “counter-clockwise”.
[3] Ok, we are cheating here: our hand is borrowed from http://commons.wikimedia.org/wiki/File:Stop_hand.png.