When your new animated brush is created, it is displayed within the image window and you would like save it into a gih format. You select
→ menu, name your work with the gih extension in the new window relevant field and as soon as you pressed the Save button, the following window is displayed:Figura 7.18. El diàleg per a descriure el pinzell animat
Quadre de diàleg que apareix quan es desa un pinzell animat
Aquest quadre de diàleg té moltes opcions que no són fàcils d'entendre. Permeten determinar la manera d'animar el pinzell.
L'«Espaiat» és la distància entre les marques consecutives del pinzell quan es traça una pinzellada amb el punter. Heu de considerar que dibuixar amb un pinzell, és com si estiguéssiu estampant. Si l'espaiat és baix, els cops estampats estaran més a prop i les traces semblaran més contínues. Si l'espaiat és alt, els cops estaran més separats: això és interessant amb els pinzells de figures, com el del «pebrot verd», per exemple. El valor varia des de l'1 fins a 200 i aquest percentatge es refereix al «diàmetre» del pinzell: 100% és un diàmetre; a 50, els pebrots estan mig superposats, mig diàmetre; a 100, un diàmetre de separació; a 150, un diàmetre i mig de separació; 200, dos diàmetres de separació.
És el nom del pinzell que apareix a dalt en el diàleg dels pinzells (mode graella) quan el pinzell està seleccionat.
That is size of cells you will cut up in layers. Default is one cell per layer and size is that of the layer. Then there is only one brush aspect per layer.
Podríem tenir només una gran capa i separar-la en cel·les que s'utilitzaran pels diferents aspectes del pinzell animat.
For instance, we want a 100×100 pixels brush with 8 different aspects. We can take these 8 aspects from a 400×200 pixels layer, or from a 300×300 pixels layer but with one cell unused.
És el nombre de cel·les (una per aspecte), que es tallarà en cada capa. Per defecte, aquest és el nombre de capes ja que només hi ha una capa per aspecte.
Això mostra com es disposen les cel·les en les capes. Si per exemple, heu situat vuit cel·les a dues cel·les per capa en quatre capes, el GIMP mostrarà 1 fila de 2 columnes per cada capa
.
Les coses es compliquen. Calen explicacions per a entendre com es disposen les cel·les i les capes.
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.
Llavors, el GIMP crea una matriu informàtica a partir d'aquesta pila amb les Dimensions que heu indicat, podeu utilitzar-ne quatre.
En informàtica, una matriu té la forma (x,y,z) per a una taula de 3 dimensions (3D). És fàcil imaginar una taula 2D: sobre el paper, és una taula amb files i columnes
Amb una taula 3D no parlem de files i columnes però si de Dimensions i Rangs. La primera dimensió està a l'eix x, la segona a l'eix y, i la tercera a l'eix z. Cada dimensió té rangs de les cel·les.
To fill up this array, GIMP starts retrieving cells from the top of stack. The way it fills the array reminds that of an odometer: right rank digits turn first and, when they reach their maximum, left rank digits start running. If you have some memories of Basic programming you will have, with an array(4,2,2), the following succession: (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). We will see this later in an example.
A més del nombre de rang que es pot donar a cada dimensió, també es pot afegir un mode Selecció. Hi ha diversos modes que s'aplicaran quan es dibuixin:
El GIMP selecciona un rang de les dimensions interessades en funció de l'ordre dels rangs que hi ha en aquesta dimensió.
El GIMP selecciona un rang aleatori des de la dimensió interessada.
El GIMP selecciona un rang en la dimensió interessada d'acord amb l'angle de desplaçament del pinzell.
El primer rang és per a la direcció 0°, cap amunt. Els altres rangs estan afectats, en el sentit horari, en un angle on el valor és 360/nombre de rangs. Per tant, amb 4 rangs en la direcció interessada, l'angle girarà 90° en sentit horari per cada canvi de direcció: el segon rang estarà afectat a 90° (cap a la dreta), el tercer rang a 180° (cap avall) i el quart a 270° (-90°) (cap a l'esquerra).[2]
Aquestes opcions són per a tauletes gràfiques perfeccionades.
Exemples
Bé. Per què és útil tot això? Ho veurem gradualment amb exemples. Podeu situar en cada dimensió casos que donaran al pinzell animat una acció particular.
Comencem amb un pinzell 1D que permet estudiar les accions en modes de selecció. Es pot imaginar així:
Seguiu els passos següents:
Select
→ from the image menu.Set Width and Height for example to 30 pixels.
In the Advanced Options, set the Color space to RGB color and set Fill with to Transparency.
Using the Text tool create 4 layers «1», «2», «3», «4». Delete the «background» layer.
Select
.xcf
file to keep its properties.
Select
.gih
extension.
Export the image with a .gbr
extension in the
brushes
directory in your personal
GIMP folder. The location of this folder depends on your
OS:
Linux: /home/user_name/.config/GIMP/2.10/
macOS: /Users/user_name/Library/Application Support/GIMP/2.10/
Windows: C:\Users\user_name\AppData\Roaming\GIMP\2.10\
In the Export Image as Brush Pipe dialog, provide a Description, set the Spacing (percent) to 100, set the Cell size to 30×30, set Dimension to 1, and set Ranks to 4, and the Selection dropdown to incremental. Then click the button.
In the Brush Dialog, click on
the button
.
Your brush appears among the other brushes. You can use it immediately, without restarting GIMP.
Select your brush. Select pencil tool for instance and click and hold with it on a new image:
Veureu els dígits 1, 2, 3, 4 seguits, en ordre.
Take your .xcf
image file
back and save it as .gih
setting the Selection dropdown to random:
Els dígits es mostraran a l'atzar.
Now set the Selection dropdown to angular:
Ara crearem un pinzell 3D animat: la seva orientació variarà segons la direcció del pinzell (4 direccions) alternant regularment esquerra i dreta, el color canviarà a l'atzar entre negre i blau.
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). Thus there are 4×2×2 = 16 cells. We need 16 images.
Crea imatges de la dimensió 1 (x)
Open a new 30×30 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).
Open the Layer Dialog. Double click on the layer to open the Layer Attributes Dialog and rename it to handL0k.
Duplicate the layer. Let visible only the duplicated layer, select it and apply
→ → . Rename it to handL90k.Repetiu la mateixa operació per a crear handL180k i handL-90k (o handL270k).
Creació d'imatges de dimensió 2 (i)
Aquesta dimensió en el nostre exemple té dos rangs, un per a la mà esquerra i un altre per a la mà dreta. La mà esquerra ja existeix. Construirem les imatges de la mà dreta capgirant-les horitzontalment.
Duplicate the handL0k layer. Let it visible only and select it. Rename it to handR0K. Apply
→ → .Repetiu la mateixa operació en les altres capes de la mà esquerra, per a crear les mans dretes equivalents.
Re-order layers to have a clockwise rotation from top to bottom, alternating Left and Right: handL0k, handR0k, handL90k, handR90k, …, handR-90k.
Creació d'imatges de dimensió 3 (z)
Crea imatges de la dimensió 3 (z): la tercera dimensió té dos rangs, un per al color negre i un altre per al color blau. El primer rang, el negre, ja existeix. Veiem que les imatges de la dimensió 3 seran una còpia en blau de les imatges de la dimensió 2. Així que tindrem 16 imatges. Però una fila de 16 capes no és fàcil de gestionar: llavors utilitzarem capes amb dues imatges.
Select the handL0k layer and let it visible only. Use change the canvas size to 60×30 pixels.
→ toDupliqueu la capa hand0k. Damunt la còpia, ompliu la mà amb blau utilitzant l'eina Pot de pintura.
Seleccioneu l'eina Mou. Doble clic per a accedir a les seves propietats: marqueu l'opció Mou la capa actual. Moveu la mà blava a la part dreta de la capa amb precisió amb l'ajuda de l' .
Make sure only handL0k and its blue copy are visible. Right click on the Layer Dialog: Apply the Expand as Necessary. You get a 60×30 pixels layer with the black hand on the left and the blue hand on the right. Rename it to «handsL0».
command with the optionRepetiu la mateixa operació sobre les altres capes.
Ordena les capes
S'han d'ordenar les capes perquè el GIMP pugui trobar la imatge desitjada en el moment de l'ús del pinzell. Les capes ja estan en ordre però s'ha d'entendre de forma més general com posar-les en ordre. Hi ha dos mètodes per a fer-ho. El primer és matemàtic: el GIMP divideix primer les 16 capes per 4; això dona 4 grups de 4 capes per a la primera dimensió. Cada grup representa una direcció del pinzell. Llavors, una altra divisió per 2; això dona 8 grups de 2 capes per a la segona dimensió: cada grup representa l'alternança E/D. Una altra divisió per 2 per a la tercera dimensió per a representar un color a l'atzar entre negre i blau.
L'altre mètode és visual, basat en la representació de la matriu. La correlació entre els dos mètodes es representa en la següent imatge:
Com llegeix el GIMP aquesta matriu? El GIMP comença amb la primera dimensió que està programada per una tria «angular», per exemple, 90°. En aquest rang de 90°, en groc en la segona dimensió, se selecciona l'alternança E/D de manera «incremental». Llavors, en la tercera dimensió, en forma aleatòria, es tria un color. Finalment, les nostres capes han de tenir l'ordre següent:
Voilà. Your brush is ready. Save it as
.xcf
first, then export as
.gih
with the following
parameters:
Espaiat: 100
Descripció: mans
Cell Size: 30×30
Nombre de cel·les: 16
Dimensions: 3
Dimensió 1: 4 rangs Selecció: angular
Dimensió 2: 2 rangs Selecció: incremental
Dimensió 3: 2 rangs Selecció: aleatòria
Place your .gih
file into
the GIMP brush directory and refresh the brush
box (see steps above). You can now use your brush.
Figura 7.19. Aquí hi ha el resultat de traçar una selecció el·líptica amb el pinzell:
Aquest pinzell alterna la mà dreta i la mà esquerra amb regularitat, els colors negre i blau a l'atzar, d'acord amb les quatre direccions del pinzell.
[2] En les versions anteriors del GIMP, es podia reemplaçar « el sentit horari» pel « sentit antihorari».
[3] Ok, we are cheating here: our hand is borrowed from https://commons.wikimedia.org/wiki/File:Stop_hand.png.