第7章 GIMP でお絵描き

目次

1. 選択
1.1. 境界のぼかし
1.2. 不完全透過な選択の作成
2. 選択範囲の作成と利用
2.1. Moving or Resizing a Selection
2.2. 選択範囲の加減
3. The Quick Mask
3.1. 概観
3.2. 属性
4. Using Quick Mask Mode
5. パス
5.1. パスの作成
5.2. パスの性質
5.3. パスと選択範囲
5.4. パスの変形
5.5. パスの境界線を描画
5.6. パスとテキスト
5.7. パスと SVG ファイル
6. ブラシ
7. ブラシの追加
8. GIH ダイアログ
9. Changing brush size
9.1. How to change the size of a brush
9.2. ブラシの手早い作成
10. グラデーション
11. パターン
12. パレット
12.1. カラーマップ
13. プリセット
14. 単純なものの描画
14.1. 直線の引き方
14.2. 基本図形を描画

1. 選択

画像の加工をする際に、 部分的に限定して操作したい場合がよくあります。 GIMP ではその部分を 選択 することで作業をすすめます。 どんな画像もそれぞれに 選択範囲 をひとつ持っています。 GIMP の操作はほとんどすべて画像の選択範囲に対してのみ及ぼされます。

図7.1 どうすればこの樹を単独にできるか?

どうすればこの樹を単独にできるか?

いかに的確に選択をするかが結果を大きく左右するとの事例は枚挙に暇がありませんが、 なかなか容易くは為し得ません。 たとえば上図の画像の問いには、 背景を残し中央の樹を切り取って、 別の画像に樹のほうを貼りつけようかと思っています。 この作戦では樹の部分だけを選択しなければなりません。 そこが難しいところで、 樹の形は複雑ですしところどころ背景の物体と見分けがつかなくなっています。

図7.2 普段、 選択範囲を示すのは破線だ。

普段、 選択範囲を示すのは破線だ。

さてここからが大変重要なところですが、 理解するまでにはちょっと骨が折れます。 通常は選択範囲をとると、 その領域は画像上では破線で囲われて見えています。 これを見れば選択とは境界線により区切られた、 内側の選択範囲と外側の非選択範囲をつくるというのがおおよその考え方でしょう。 この概念はたしかにさまざまな場面で有効ですが、 実際は不正確です。

実を言うと選択の実装は チャンネル でできています。 内部構造的には、 選択のチャンネルは赤・緑・青およびアルファのチャンネルとは別に設けられます。 そして画像の各画素 (ピクセル) ごとに、 0 (非選択) から255 (完全選択) までの値を定めることで選択は成り立っています。 こうしたやり方が有利なのは、 画素によっては 0 でも 255 でもない中間の値をとることで 不完全選択 が可能になるからです。 今後は選択と非選択の間のゆるやかな変化を必要とする場面にたびたび遭遇することになるでしょう。

では一体、 選択範囲をつくったときにできる点線は何なのでしょう。

答えは 等高線 です。 この点線は選択の比率の値が半分以上の領域と半分未満の領域との境目を示しています。

図7.3 Same selection in Quick Mask mode.

Same selection in Quick Mask mode.

While looking at the dashed line that represents the selection, always remember that the line only tells part of the story. If you want to see the selection in full detail, the easiest way is to click the Quick Mask button in the lower left corner of the image window. This causes the selection to be shown as a translucent overlay atop the image. Selected areas are unaffected; unselected areas are reddened. The more completely selected an area is, the less red it appears.

Many operations work differently in Quick Mask mode, as mentioned in the Quick Mask overview. Use the Quick Mask button in the lower left corner of the image window to toggle Quick Mask mode on and off.

図7.4 Same selection in Quick Mask mode after feathering.

Same selection in Quick Mask mode after feathering.

1.1. 境界のぼかし

With the default settings, the basic selection tools, such as the Rectangle Select tool, create sharp selections. Pixels inside the dashed line are fully selected, and pixels outside completely unselected. You can verify this by toggling Quick Mask: you see a clear rectangle with sharp edges, surrounded by uniform red. Use the Feather edges checkbox in the Tool Options to toggle between graduated selections and sharp selections. The feather radius, which you can adjust, determines the distance over which the transition occurs.

If you are following along, try this with the Rectangle Select tool, and then toggle Quick Mask. You will see that the clear rectangle has a fuzzy edge.

切り取って貼り付ける作業には境界をぼかす方法がうってつけです。 貼り付けられた部品が目立たずなめらかににその背後と溶け合います。

It is possible to feather a selection at any time, even if it was originally created as a sharp selection. Use SelectFeather from the main menu to open the Feather Selection dialog. Set the feather radius and click OK. Use SelectSharpen to do the opposite—sharpen a graduated selection into an all-or-nothing selection.

[注記] 注記

技術的な話題ですが、 境界のぼかしは ガウスぼかし を使用しており、 与えられた量をぼかし半径として選択チャンネルに作用させています。

1.2. 不完全透過な選択の作成

レイヤーは透明度を設定できますが、 選択は同じようにはできません。 しかしガラスのような透明の画像が作れたら非常に便利です。 レイヤーの不透明度の設定はつぎのような手順でできます。

  • 単純な選択であれば、 消しゴムツールを使います。 不透明度はお好みで調節できます。

  • For complex selections: use SelectFloat to create a floating selection. This creates a new layer with the selection called Floating Selection (「選択範囲のフロート化」). Set the opacity slider in the Layer Dialog to the desired opacity. Then anchor the selection: outside the selection, the mouse pointer includes an anchor. When you click while the mouse pointer includes the anchor, the floating selection disappears from the Layer Dialog and the selection is at the right place and partially transparent (anchoring works this way only if a selection tool is activated: you can also use the Anchor Layer command in the context menu by right clicking on the selected layer in the layer dialog).

    And, if you use this function frequently: Ctrl-C to copy the selection, Ctrl-V to paste the clipboard as a floating selection, and LayerNew Layer… to turn the selection into a new layer. You can adjust the opacity before, or after creating the new layer.

  • Another way: use LayerMaskAdd Layer Masks… to add a layer mask to the layer with the selection, initializing it with the selection. Then use a brush with the desired opacity to paint the selection with black, i.e. paint it with transparency. Then LayerMaskApply Layer Mask. See 「レイヤーマスク」.

  • 画像の背景を一様に透明化 したいときは、 アルファチャンネルを追加してから 「Fuzzy Selection (Magic wand)」 で背景を選択します。つづいて 「スポイト (カラーピッカー)」 で背景色を取り込んだ色に対して 「塗りつぶし」 ツールを使います。 色消しゴム モードにすると描画色に指定された色の画素は消され、 その他の画素は不完全に消去されるため色が変化します。

    最も単純なのは 編集消去 する方法で、 選択範囲が完全透過になります。