[Part I. GIMP基礎功]

[Part II. 一種效果的誕生]
[Part III. Script-Fu的秘密]



26.3 一步一步做,讓雲霧消失

以下,操作 GIMP 圖形介面,一步一步做,生成小島圖案。
藉由這過程,瞭解程式碼的意思。


Step 1.
  • 執行[影像] / 檔案 / 新增【註1】,新增一個透明底色256x256影像,圖層更名為 bottom 。

  • 對應的程式碼
35: (img (car (gimp-image-new width height RGB)))
36: (layer-one (car (gimp-layer-new img width height
37: RGB-IMAGE "Bottom" 100 NORMAL-MODE)))
38: (layer-two 0)


Step 2.
  • 執行[影像] / 濾鏡 / 描繪 / 雲狀 / Solid Noise【註2】,勾選「可鋪排」選項,不勾選「湍流」選項,產生灰階霧狀效果。勾選可鋪排選項,產生的圖案是無接縫的圖案。


  • 對應的程式碼
42: (gimp-image-add-layer img layer-one 0)
43:
44: (plug-in-solid-noise RUN-NONINTERACTIVE img layer-one TRUE FALSE seed detail xscale yscale)


Step 3.
  • 執行[影像] / 色彩 / 自動 / Stretch Contrast【註3】,增強明暗對比。

  • 對應的程式碼
45: (plug-in-c-astretch RUN-NONINTERACTIVE img layer-one)


Step 4.
  • 複製 Bottom 圖層,得到新圖層「Bottom 複製本」。
  • 在英文介面裡,「Bottom 複製本」相當於 Bottom Copy

  • 對應的程式碼
46: (set! layer-two (car (gimp-layer-copy layer-one TRUE)))
47: (gimp-image-add-layer img layer-two -1)
48: (gimp-image-set-active-layer img layer-two)


Step 5.
  • 在漸層面版內,選擇 Land 1 漸層。
  • 對「Bottom 複製本」,執行[影像] / 色彩 / 映射 / Gradient Map【註4】,使用 Land 1 漸層,將黑白圖案變成彩色的圖案。


  • 對應的程式碼
50: (plug-in-gradmap RUN-NONINTERACTIVE img layer-two)


選單及項目名稱的英文:
【註1】[Image] / File / New
【註2】[Image] / Filters / Render / Clouds / Solid Noise,勾選Tilable,不勾選Turbulent
【註3】[Image] / Colors / Auto / Stretch Contrast
【註4】[Image] / Colors / Map / Gradient Map
注意!
在2.6.7版,Clouds的譯詞是「雲朵」,之前的版本是「雲狀」,我個人偏好「雲狀」一詞。 在2.6.7版,Colors的譯詞是「顏色」(作為選單時),之前的版本是「色彩」,我個人偏好「色彩」一詞。