2. 画像構造に関連するダイアログ

ここで述べるダイアログは レイヤーチャンネルパス のような画像の構造を制御したり操作するためのものです。

2.1. Layers Dialog

図 14.1. Layers Dialog

Layers Dialog

The 「Layers」 dialog is the main interface to edit, modify and manage your layers. You can think of layers as a stack of slides or clothes on your body. Using layers, you can construct an image of several conceptual parts, each of which can be manipulated without affecting any other part of the image. Layers are stacked on top of each other. The bottom layer is the background of the image, and the components in the foreground of the image come above it.

図 14.2. An image with layers

An image with layers

Layers of the image

An image with layers

Resulting image


2.1.1. Activating the dialog

The 「Layers」 dialog is a dockable dialog; see the section 項2.3. 「ダイアログとその合体」 for help on manipulating it.

You can access it:

  • from the image menu: WindowsDockable DialogsLayers;

  • from the Tab menu in any dockable dialog by clicking on and selecting Add TabLayers,

  • from the (default) shortcut: Ctrl+L.

In the Windows menu, there is a list of detached windows which exists only if at least one dialog remains open. In this case, you can raise the 「Layers」 dialog from the image-menu: WindowsLayers.

2.1.2. Using the Layer dialog

Overview

Every layer appears in the dialog in the form of a thumbnail. When an image has multiple layers as components, they appear as a list. The upper layer in the list is the first one visible, and the lowest layer the last visible, the background. Above the list one can find characteristics related individually to each layer. Under the list one can find management buttons for the layer list. A right-click in a layer thumbnail opens the Layer context menu.

Layer attributes

Every layer is shown in the list along with its attributes:

Layer visibility

In front of the thumbnail is an icon showing an eye. By clicking on the eye, you toggle whether the layer is visible or not. (Shift-clicking on the eye causes all other to be temporarily hidden.)

Chain layers

Another icon, showing a chain, allows you to group layers for operations on more than one layer at a time (for example with the Move tool).

Layer name

The main attribute is the name of the layer. You can edit this by a double-click on the name or the thumbnail of the layer.

[注意] 注意

In the case of an animation layer (GIF or MNG), the name of the layer can be used to specify certain parameters : Layer_name (delay in ms) (combination mode), for example Frame-1 (100 ms) (replace). The delay sets the time during which the layer is visible in the animation. The combination mode sets whether you combine the layer with the previous layer or replace it: the two modes are (combine) or (replace).

Layers characteristics

Above the layer list, it is possible to specify some properties for the active layer. The active layer is the one highlighted in blue. The properties are : "Layer mode", "Lock Alpha channel", and "Opacity".

Layer modes

The layer mode determines how the layer interacts with the other layers. From the combo box you can access all the modes provided by GIMP. The layer modes are fully detailed in 項2. 「レイヤーのモード」.

Lock

If you check this option the transparent areas of the layer will be kept, even if you have checked the Fill transparent areas option for the Bucket fill tool.

図 14.3. Example for Locking Alpha Channel

Example for Locking Alpha Channel

The active layer has three horizontal, opaque, green stripes on a transparent background. We paint a vertical red stripe. 「Lock」 unchecked: Opaque and transparent areas of the active layer are painted with red.

Example for Locking Alpha Channel

Lock」 checked: Only opaque areas of the active layer are painted with red. Transparent areas are preserved.


[ティップ] ティップ

If a layer name in the Layer Dialog is in bold, then this layer has no Alpha channel.

Opacity

By moving the slider you give more or less opacity to the layer. With a 0 opacity value, the layer is transparent and completely invisible. Don't confuse this with a Layer Mask, which sets the transparency pixel by pixel.

Layer management

Under the layer list a set of buttons allows you to perform some basic operations on the layer list.

New layer

Here you can create a new layer. A dialog is opened where you can enter the Layer name, perhaps change the default Height and Width, and choose the Layer fill type that will be the new layer's background.

Raise layer

Here you can move the layer up a level in the list. Press the Shift key to move the layer to the top of the list.

Lower layer

Here you can move the layer down a level in the list. Press the Shift key to move the layer to the bottom of the list.

[ティップ] ティップ

To move a layer at the bottom of the list, it may first be necessary to add a transparency channel (also called Alpha channel) to the Background layer. To do this, right click on the Background layer and select Add Alpha channel from the menu.

Duplicate layer

Here you can create a copy of the active layer. Name of new layer is suffixed with a number.

Anchor layer

When the active layer is a temporary layer (also called floating selection) shown by this icon , this button anchors it to the previous active layer.

Delete layer

Here you can delete the active layer.

More layer functions

Other functions about layer size are available in the Layer Drop down menu you get by right clicking on the Layer Dialog. You can find them also in the Layer sub-menu of the image menu.

You will find merging layers functions in the Image menu.

Clicking-and-dragging layers

Click and hold on layer thumbnail: it enlarges and you can move it by dragging the mouse.

  • So you can put this layer down somewhere else in the layer list.

  • You can also put the layer down into Toolbox: a new image is created that contains this layer only.

  • Finally, you can put the layer down into another image: this layer will be added to the layer list, above existing layers.

2.1.3. レイヤーマスク

図 14.4. レイヤーマスク追加」ダイアログ

レイヤーマスク追加ダイアログ

概観

レイヤーには各層ごとにレイヤーマスクと呼ばれる透過効果マスクが加えられます。 レイヤーマスクはレイヤーと同じ大きさがあり、 属するレイヤーの各画素に対応する同数の画素をもっています。 つまりマスクの各画素はレイヤーと同位置の画素と対をなしています。 マスクは 0 から 255 の値をもつ陰影画素の集合です。 値が 0 の画素は黒くなり対応するレイヤーの画素を完全透過にします。 値が 255 の画素は白になり、 対応するレイヤーの画素を完全不透明にします。

レイヤーマスクを加えるにはまずそのレイヤーをマウスの 第2ボタン でクリックすると出てくる脈絡メニューで レイヤーマスクの追加... を選んでください。 するとダイアログが開かれ、 つぎのようなマスクの内容で初期化できます。

  • 完全不透明(白): ダイアログ上ではマスクは白くなります。 マスクを白く塗るとレイヤーの画素が完全に可視化することから、 この場合、 画像ウィンドウの全ての画素が見えます。 黒でマスクを塗るとレイヤーのその位置は透明になります。

  • 完全透明(黒): ダイアログ上ではマスクは黒くなります。 マスクを黒く塗るとレイヤーの画素が透明になりますから、 この場合レイヤーは完全透過です。 白でマスクを塗るとマスクは剥がれ、 レイヤーの画素が見えるようになります。

  • レイヤーのアルファチャンネル: マスクはレイヤーのアルファチャンネルの内容どおりに初期化されます。 既にレイヤーに透過効果があればそれがマスクに複写されますが、 もしなければ「完全透明(黒)」と同じように初期化されます。

  • レイヤーのアルファチャンネルを移転: マスクの初期化は前のオプションと同じですが、 レイヤーのアルファチャンネルが全面的に完全不透明に戻されます。

  • 選択範囲: マスクは各画素の選択の値をもとに初期化されます。

  • レイヤーのグレースケールのコピー: マスクはレイヤーの画素の値をもとに初期化されます。

  • チャンネル: 選択マスク を作成しチャンネルダイアログに保管してあれば、 それをレイヤーマスクの初期化に利用できます。

  • マスク反転: このチェックボックスで白黒が反転します。

マスクを作成すると、 その縮小画像がレイヤーの縮小画像の右隣に現れます。 レイヤーとレイヤーマスクはその縮小見本画像のどちらか一方をクリックすればそれが描画対象になります。 活性化された方に白の枠線 (マスクが白くなっていると見えづらいです) がつきます。 これが肝心な点で、 キャンバスを見たところで描画対象がレイヤーなのかマスクなのかは一切分かりませんので、 マスクを扱う際には常にレイヤーダイアログが見えるようにしておきましょう。

Alt キーを押しながら (システムによっては Ctrl+Alt の組み合わせを押しながら) レイヤーダイアログ上のレイヤーマスクの縮小見本画像をクリックすると、 レイヤーマスクを表示 のコマンドがはたらき、 マスク縮小見本の枠線が緑色に変わります。 代わりに Ctrl キーを押しながらのクリックだと レイヤーマスクを無効化 のコマンドがはたらき、 枠線は赤色に変わります。 通常表示に戻すには直前のコマンドを再度実行してください。 これらのオプションは作業を容易にするためにあります。

レイヤーマスクの例

図 14.5. レイヤーマスク付きのレイヤー

レイヤーマスク付きのレイヤー

画像には花が写っている背景レイヤーと、 その上に完全不透明な青いレイヤーがある。 白いレイヤーマスクが青のレイヤーに加えられた。 白いマスクはレイヤーの画素を完全可視化するので、 画像ウィンドウでは依然として青いレイヤーが見えている。


図 14.6. レイヤーマスクに描くと

レイヤーマスクに描くと

レイヤーマスクを活性化した。 黒で描くとレイヤーが透過する。 背後のレイヤーが見えるようになる。