summaryrefslogtreecommitdiffstats
path: root/doc/chalk/using-layers.docbook
blob: 3ca802917fd4a5587ca9ce5d844fd0b9286398c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
<chapter id="layers">
<title>Layers</title>

<para>
This chapter gives an overview of how layers work in &chalk;.
</para>

<sect1 id="layers-background">
<title>Background information on layers</title>

<para>
Extensive use of &chalk; will almost require you to have some knowledge of
layers. Using layers, you can work on one part of the image without touching
the rest of it, and most effects are best applied on a layer, instead of on
the whole image. Of course, if you do want to apply an effect to an entire
image, &chalk; does offer you that possibility, and there is nothing against
it.
</para><para>
The idea behind layers is quite simple. As the name suggests, layers lie on
top of each other, and together form the layer stack. The final resulting
image is that what you see when looking through the stack from top to bottom.
This means that usually the upper layers of your image will have more or less
transparency, since you cannot look through a layer which has no transparency.
(&chalk; works with opaqueness instead of transparency. A layer that is 100
percent opaque is 0 percent transparent, and vice versa.) A layer higher in
the stack gets applied later than one lower in the stack. For example, if your
image contains four layers, numbered from 1 (lowest) to 4 (highest), the
effect that layer number 4 adds to the image, is applied to the result from
applying layers 1 through 3.
</para><para>
Every image you edit in &chalk; contains layers. When you create a new image,
the layer box (usually shown at the bottom right of your screen, see <link
linkend="commands-palettes-layers-layers">this section</link>) will contain
one layer. The painting and editing you do is then applied to that layer. Once
you add more layers, you can choose on which part of the image you want to
work, by selecting the respective layer. All further painting is then applied
to that layer, until you select another one.
</para><para>
Layers are also an excellent way to check whether adding certain effects (or
applying certain image modifications) come out right. Add a layer which
contains what you want to try out, and show or hide it with the eye icon in
the layer box. You can especially profit from this method if you have multiple
effects to check out: show and hide them in any combination, and decide which
you like best. And since you can move the layers around, you can also
experiment with the order in which the effects are applied.
</para><para>
See the <link linkend="tutorial-select-layer">Selections and layers
tutorial</link> for a small hands-on introduction.
</para>
</sect1>

<sect1 id="layers-layerbox">
<title>The layer box</title>

<para>The layer box is the instrument you will use most to work with layers. It
gives an overview of the layers that are present in your image, and using it
you can manage layers by adding, removing, reordering or modifying them.
</para><para>
The layer box consists of three parts. The middle part gives an overview of the
layers in the image. At the top, you can set some properties for the current
layer. At the bottom, a couple of layer management options can be found. The
next sections describe these three parts in more detail.
</para>

<sect2 id="layers-layerbox-overview"> 
<title>Layer overview</title>

<para>This part shows you which layers are present in your image. In a tree-like
structure, the layer group hierarchy is shown: layers that are contained within
a layer group are displayed a bit to the right to indicate their belonging to
that group. 
</para><para>
For each layer, a thumbnail preview and its name are shown. The layer name
is preceded by a folder icon if it is a group layer. Furthermore, two
indicators are present: the eye icon shows whether the layer is currently
visible (an open eye indicates that the layer is visible, a closed eye
indicates that it is not), and the lock icon shows whether the layer is
locked. No changes can be made to a locked layer.
</para><para>
When you click on a layer's eye icon, its visibility is switched from on to
off or vice versa. Clicking on the lock icon enables or disables editing of
that layer. You can click on the name of the current layer to rename it.
Note that to rename a layer, it has to be the current one. You do not need to
activate a layer in order to make it (in)visible or (un)locked via the eye and
lock icons, respectively: these work directly.
</para><para>
Doubleclick on a layer entry in the list to open the <link
linkend="commands-dialogs-layers-layerproperties"><guilabel>Layer
Properties</guilabel></link> dialog. This dialog shows a layer's colorspace and
profile. You can also change its name, opacity and composite mode here.
</para>
</sect2>

<sect2 id="layers-layerbox-options"> 
<title>Layer options</title>
<para>
The top of the layer box contains two controls for setting properties of the
currently selected layer. The list box at the left allows you to quickly set
the layer's composite mode. The spin field and slider at the right can be used
to change the layer's opacity.
</para><para>
At the bottom of the layer box, there are five buttons. From left to right,
these are as follows. The <guibutton>New Layer</guibutton> icon brings up a
submenu from which you can choose which type of layer you want to add. This
menu can also be opened by clicking with the &RMB; on the layer box. The
<guibutton>Move Layer Down</guibutton> and <guibutton>Move Layer Up</guibutton>
buttons move the current layer one level down and up, respectively, within the
current layer group. If the layer is already the last or first within the
layer group, trying to move it further will move it out of the layer group.
The <guibutton>Layer Properties</guibutton> button opens the <link
linkend="commands-dialogs-layers-layerproperties"><guilabel>Layer
Properties</guilabel></link> dialog, just as when you would have doubleclicked
on the layer. The <guibutton>Delete Layer</guibutton> button deletes the
current layer.
</para>
</sect2>

</sect1>

<sect1 id="layers-working">
<title>Working with layers</title>

<para>
Because layers are quite important when extensively using &chalk;, you can
perform a lot of operations on them. These are all available via the <link
linkend="commands-menus-layer"><guimenu>Layer</guimenu> menu</link>. Some of
the possibilities:
</para>

<variablelist>
<varlistentry><term></term><listitem><para>Add, remove, and duplicate layers;</para></listitem></varlistentry>
<varlistentry><term></term><listitem><para>Create and edit layer masks;</para></listitem></varlistentry>
<varlistentry><term></term><listitem><para>Flip, rotate, scale and shear layers;</para></listitem></varlistentry>
<varlistentry><term></term><listitem><para>Convert layers between colorspaces;</para></listitem></varlistentry>
<varlistentry><term></term><listitem><para>Save layers as images;</para></listitem></varlistentry>
<varlistentry><term></term><listitem><para>View layer histograms.</para></listitem></varlistentry>
</variablelist>

</sect1>

<sect1 id="layers-adjustment">
<title>Adjustment Layers</title>

<para>Adjustment layers are layers that consist of a filter and an optional
selection. The filter effect is applied to the composite image of all
layers under the adjustment layer in the current layer group. The big
thing is, adjustment layers apply these effects non-destructively. The
original image data is not modified.
</para><para>
Almost all &chalk; filters are suitable for use in adjustment
layers -- even filters that would downgrade the image quality. For instance,
the raindrops filter converts to 8-bit RGB before working its magic. If you
would try to use this filter directly on a 16-bit L*a*b* layer, &chalk; would
warn you about the conversion to RGB and back again this filter would cause.
Not so with adjustment layers: the original data isn't touched, so applying
the filter is safe.
</para><para>
What about the colorspace of an adjustment layer then? In order to examine
this issue, you need to know what happens when &chalk; renders an adjustment
layer.
</para>

<sect2 id="layers-adjustment-selections">
<title>Adjustment layers and selections</title>

<para>If the currently active layer has an active selection, then that selection
will be copied and used as a mask for the adjustment layer. If there is no
active selection, then there will be no mask and the adjustment will apply to
the entire extent of the layers under the adjustment layer in the current
group. There is <emphasis>no</emphasis> way of adding a mask to an existing
adjustment layer.
</para><para>
If there is a mask in the adjustment layer, you can edit the mask using the
ordinary painting tools and painting operations.
</para>

</sect2>

<sect2 id="layers-adjustment-projection">
<title>A note on projections</title>

<para>
&chalk; composites the layers bottom to top, within each layer group. The
aggregate -- or the projection as it is also called -- is then filtered by
the adjustment layer. If there are layers on top of the adjustment layer,
those are composited onto the projection. &chalk; converts all layer data before
compositing, so if the bottom-most layer in an image is grayscale, all layers
are converted to grayscale before compositing -- and that means that the
adjustment layer projection will be grayscale, too.
</para><para>
With this knowledge you'll understand why &chalk; can often offer better
performance working with layers on top of an adjustment layer which is on top
of a complex layer structure: &chalk; uses the projection and doesn't even look
anymore at the layers under the adjustment layer. Unless, of course, you
change one of them.
</para>
</sect2>

</sect1>

<sect1 id="layers-composite">
<title>Compositing modes</title>

<para>
Layers can be composited in various ways, each yielding a different effect.
This section describes the available compositing modes. Each description is
accompanied by an example: on top of an original image (see below), a rainbow
gradient is added.
</para>

<para>
<screenshot>
<screeninfo>The original image</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="mountains-original.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The original image</phrase>
</textobject>
<caption><para>The original image</para></caption>
</mediaobject>
</screenshot>
</para>

<sect2 id="layers-composite-normal">
<title><guilabel>Normal</guilabel></title>

<para>
The <guilabel>Normal</guilabel> mode does nothing special. It adds the layer
to the image, and if no other special effects like opacity are changed, the
underlying layers will only be visible at places where the new layer is
itself transparent.
</para>

<para>
<screenshot>
<screeninfo>The gradient applied with the <guilabel>Normal</guilabel> compositing
mode</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="mountains-normal.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The gradient applied with the <guilabel>Normal</guilabel> compositing
mode</phrase>
</textobject>
<caption><para>The gradient applied with the <guilabel>Normal</guilabel> compositing
mode</para></caption>
</mediaobject>
</screenshot>
</para>

</sect2>

<sect2 id="layers-composite-multiply">
<title><guilabel>Multiply</guilabel></title>

<para>
The <guilabel>Multiply</guilabel> mode blends the two layers so that the
bottom layer gets <quote>colorized</quote> by the new layer. The resulting
image is generally quite dark.
</para>

<para>
<screenshot>
<screeninfo>The gradient applied with the <guilabel>Multiply</guilabel> compositing
mode</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="mountains-multiply.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The gradient applied with the <guilabel>Multiply</guilabel> compositing
mode</phrase>
</textobject>
<caption><para>The gradient applied with the <guilabel>Multiply</guilabel> compositing
mode</para></caption>
</mediaobject>
</screenshot>
</para>

</sect2>

<sect2 id="layers-composite-burn">
<title><guilabel>Burn</guilabel>, <guilabel>Dodge</guilabel>,
<guilabel>Divide</guilabel> and <guilabel>Screen</guilabel></title>

<para>
The <guilabel>Burn</guilabel>, <guilabel>Dodge</guilabel>,
<guilabel>Divide</guilabel> and <guilabel>Screen</guilabel> modes all add an
extra <quote>burning</quote> effect by following contours instead of using
straight lines. In addition, <guilabel>Burn</guilabel> and
<guilabel>Divide</guilabel> use the inverted colors instead of the actual
colors of the composited layer.
</para>

<para>
<screenshot>
<screeninfo>The gradient applied with the <guilabel>Burn</guilabel> compositing
mode</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="mountains-burn.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The gradient applied with the <guilabel>Burn</guilabel> compositing
mode</phrase>
</textobject>
<caption><para>The gradient applied with the <guilabel>Burn</guilabel> compositing
mode</para></caption>
</mediaobject>
</screenshot>
</para>

<para>
<screenshot>
<screeninfo>The gradient applied with the <guilabel>Dodge</guilabel> compositing
mode</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="mountains-dodge.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The gradient applied with the <guilabel>Dodge</guilabel> compositing
mode</phrase>
</textobject>
<caption><para>The gradient applied with the <guilabel>Dodge</guilabel> compositing
mode</para></caption>
</mediaobject>
</screenshot>
</para>

<para>
<screenshot>
<screeninfo>The gradient applied with the <guilabel>Divide</guilabel> compositing
mode</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="mountains-divide.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The gradient applied with the <guilabel>Divide</guilabel> compositing
mode</phrase>
</textobject>
<caption><para>The gradient applied with the <guilabel>Divide</guilabel> compositing
mode</para></caption>
</mediaobject>
</screenshot>
</para>

<para>
<screenshot>
<screeninfo>The gradient applied with the <guilabel>Screen</guilabel> compositing
mode</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="mountains-screen.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The gradient applied with the <guilabel>Screen</guilabel> compositing
mode</phrase>
</textobject>
<caption><para>The gradient applied with the <guilabel>Screen</guilabel> compositing
mode</para></caption>
</mediaobject>
</screenshot>
</para>

</sect2>

<sect2 id="layers-composite-overlay">
<title><guilabel>Overlay</guilabel></title>

<para>
Like <guilabel>Multiply</guilabel>, the <guilabel>Overlay</guilabel> mode
colorizes the underlying layer. The resulting image is about as light as
the original layer.
</para>

<para>
<screenshot>
<screeninfo>The gradient applied with the <guilabel>Overlay</guilabel> compositing
mode</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="mountains-overlay.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The gradient applied with the <guilabel>Overlay</guilabel> compositing
mode</phrase>
</textobject>
<caption><para>The gradient applied with the <guilabel>Overlay</guilabel> compositing
mode</para></caption>
</mediaobject>
</screenshot>
</para>

</sect2>

<sect2 id="layers-composite-darken">
<title><guilabel>Darken</guilabel></title>

<para>
The <guilabel>Darken</guilabel> mode darkens the underlying layer while
colorizing it to match the colors in the composited layer.
</para>

<para>
<screenshot>
<screeninfo>The gradient applied with the <guilabel>Darken</guilabel> compositing
mode</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="mountains-darken.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The gradient applied with the <guilabel>Darken</guilabel> compositing
mode</phrase>
</textobject>
<caption><para>The gradient applied with the <guilabel>Darken</guilabel> compositing
mode</para></caption>
</mediaobject>
</screenshot>
</para>

</sect2>

<sect2 id="layers-composite-lighten">
<title><guilabel>Lighten</guilabel></title>

<para>
The <guilabel>Lighten</guilabel> mode lightens the underlying layer while
colorizing it to match the colors in the composited layer.
</para>

<para>
<screenshot>
<screeninfo>The gradient applied with the <guilabel>Lighten</guilabel> compositing
mode</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="mountains-lighten.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The gradient applied with the <guilabel>Lighten</guilabel> compositing
mode</phrase>
</textobject>
<caption><para>The gradient applied with the <guilabel>Lighten</guilabel> compositing
mode</para></caption>
</mediaobject>
</screenshot>
</para>

</sect2>

<sect2 id="layers-composite-hue">
<title><guilabel>Hue</guilabel>, <guilabel>Saturation</guilabel> and
<guilabel>Value</guilabel></title>

<para>
The <guilabel>Hue</guilabel>, <guilabel>Saturation</guilabel> and
<guilabel>Value</guilabel> modes respectively apply the hue, saturation and
value components of the composited layer to the underlying layer.
</para>

<para>
<screenshot>
<screeninfo>The gradient applied with the <guilabel>Hue</guilabel> compositing
mode</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="mountains-hue.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The gradient applied with the <guilabel>Hue</guilabel> compositing
mode</phrase>
</textobject>
<caption><para>The gradient applied with the <guilabel>Hue</guilabel> compositing
mode</para></caption>
</mediaobject>
</screenshot>
</para>

<para>
<screenshot>
<screeninfo>The gradient applied with the <guilabel>Saturation</guilabel> compositing
mode</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="mountains-saturation.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The gradient applied with the <guilabel>Saturation</guilabel> compositing
mode</phrase>
</textobject>
<caption><para>The gradient applied with the <guilabel>Saturation</guilabel> compositing
mode</para></caption>
</mediaobject>
</screenshot>
</para>

<para>
<screenshot>
<screeninfo>The gradient applied with the <guilabel>Value</guilabel> compositing
mode</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="mountains-value.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The gradient applied with the <guilabel>Value</guilabel> compositing
mode</phrase>
</textobject>
<caption><para>The gradient applied with the <guilabel>Value</guilabel> compositing
mode</para></caption>
</mediaobject>
</screenshot>
</para>

</sect2>

<sect2 id="layers-composite-color">
<title><guilabel>Color</guilabel></title>

<para>
The <guilabel>Color</guilabel> mode colorizes the underlying layer, yielding
very strong colors.
</para>

<para>
<screenshot>
<screeninfo>The gradient applied with the <guilabel>Color</guilabel> compositing
mode</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="mountains-color.png" format="PNG" />
</imageobject>
<textobject>
<phrase>The gradient applied with the <guilabel>Color</guilabel> compositing
mode</phrase>
</textobject>
<caption><para>The gradient applied with the <guilabel>Color</guilabel> compositing
mode</para></caption>
</mediaobject>
</screenshot>
</para>

</sect2>

</sect1>

<sect1 id="layers-masks">
<title>Layer Masks</title>

<para>
Basically, a layer mask is a mask that you place on your paint layer. This
will literally mask areas of the layer, so that the content underneath shows
through. You can paint on it with greyscale colors: the more black the color,
the less the layer under it will shine through, the more white, the less the
layer under it will be shown. So complete white will let nothing through,
complete black will let everything through. Basically, it is a bit like
selecting a piece of your image, and then cutting it, so that the selected
bits go away. So what is the use for a mask here? The big advantage is that it
is non-destructive: if you decide that you masked out the wrong part of your
layer, you can easily remove the mask and start anew, something a lot harder
(not to say near impossible, especially in between sessions) with regular
selection-cutting.
</para><para>
So, how to create a mask? There are 2 ways:
</para>

<itemizedlist>
<listitem><para>
Start from scratch.
<menuchoice><guimenu>Layer</guimenu><guisubmenu>Mask</guisubmenu><guimenuitem>Create
Mask</guimenuitem></menuchoice>. The mask starts with everything being
retained, that is, a complete white mask. Basically you will not see any
changes as long as you do not paint on it. 
</para></listitem>
<listitem><para>
Start from the current selection.
<menuchoice><guimenu>Layer</guimenu><guisubmenu>Mask</guisubmenu><guimenuitem>Mask
From Selection</guimenuitem></menuchoice>. The selectedness will be converted
to whiteness. This means that fully selected area will be visible, fully
unselected areas will be invisible, and the rest will be partially visible,
depending on how much the area was selected. 
</para></listitem>
</itemizedlist>

<sect2 id="layers-masks-editing">
<title>Editing the mask</title>

<para>
First, make sure you are editing the mask, not the layer, by making sure
<menuchoice><guimenu>Layer</guimenu><guisubmenu>Mask</guisubmenu><guimenuitem>Edit
Mask</guimenuitem></menuchoice> is checked. (This is checked by default.) Then
you can paint on the layer just like before, only now you are
painting on the mask, instead of on the layer itself. To stop painting on the
mask, you can uncheck the <guilabel>Edit Mask</guilabel> checkbox. There's
also the option to show the mask, through checking
<menuchoice><guimenu>Layer</guimenu><guisubmenu>Mask</guisubmenu><guimenuitem>Show
Mask</guimenuitem></menuchoice>. (This is not checked by
default). This option will render the entire layer as a visual representation
of the mask in greyscale, instead of the actual layer. This can be handy to
see where your mask is, but it might be not as handy when you want to edit it,
since you cannot look at the actual layer.
</para><para>
Other actions: you can also remove the mask if you are not satisfied with it,
and want to start over again, or just want to remove it, with
<menuchoice><guimenu>Layer</guimenu><guisubmenu>Mask</guisubmenu><guimenuitem>Remove
Mask</guimenuitem></menuchoice>. You can also <quote>apply</quote> the mask,
meaning that the mask will be made permanently. This means that the mask is
removed, but that its effect of transparency will be committed to the layer.
</para>

</sect2>
</sect1>

</chapter>