001.
; ***********************************************************
002.
; GIMP
2.6
移植時の作業
003.
;
004.
;
1
) 変数は宣言する
005.
; ( http:
006.
;
2
) set-pt を定義する
007.
; ***********************************************************
008.
(define (apply-
super
-logos01-effect image logo-layer random blur offset )
009.
(let* (
010.
(bump-layer
0
)
011.
(v_point
0
)
012.
(path-layer
0
)
013.
(outline-layer
0
)
014.
(width (car (gimp-drawable-width logo-layer))) ;ロゴの幅
015.
(height (car (gimp-drawable-height logo-layer))) ;ロゴの高さ
016.
(bg-layer (car (gimp-layer-
new
image width height RGB-IMAGE
"Background"
100
NORMAL-MODE))) ;背景レイヤー
017.
(fg-color '(
0
0
0
)) ;前景色=黒
018.
(bg-color '(
255
255
255
)) ) ;背景色=白
019.
020.
;イメージサイズ変更と背景レイヤー作成
021.
(gimp-image-add-layer image bg-layer
1
) ;背景レイヤーをlogo-layerの下にAdd
022.
(gimp-image-resize-to-layers image) ;イメージサイズをレイヤーに合わせる
023.
(gimp-selection-none image) ;選択なし
024.
(gimp-context-set-background bg-color) ;背景色を白に
025.
(gimp-edit-fill bg-layer BACKGROUND-FILL) ;背景レイヤーを白でFILL
026.
027.
;バンプマップ用イメージ作成
028.
(set! bump-layer (car(gimp-layer-copy logo-layer
1
))) ;logo-layerのコピー
029.
(gimp-image-add-layer image bump-layer -
1
) ;bump-layerをTopに追加
030.
(gimp-image-raise-layer-to-top image bump-layer)
031.
(gimp-layer-set-name bump-layer
"Text"
)
032.
033.
;テキストにプラズマ/モザイク描画
034.
(gimp-selection-layer-alpha logo-layer) ;AlphaChanelをSelecdtionMaskに
035.
(plug-in-plasma
1
image logo-layer random
7
) ;プラズマ描画
036.
(gimp-context-set-background fg-color) ;背景色を黒に
037.
(plug-in-mosaic
1
image logo-layer ;モザイク描画
038.
15
039.
4
040.
1
041.
0.65
042.
1
043.
135
044.
0.2
045.
1
046.
1
047.
1
048.
0
049.
1
)
050.
(set! v_point (cons-array
8
'
byte
)) ;明るさとコントラストを調整
051.
(set-pt v_point
0
0
0
)
052.
(set-pt v_point
1
64
64
)
053.
(set-pt v_point
2
128
226
)
054.
(set-pt v_point
3
255
255
)
055.
(gimp-curves-spline logo-layer HISTOGRAM-VALUE
8
v_point)
056.
(gimp-selection-none image)
057.
058.
;輪郭を描画
059.
; (plug-in-vpropagate
1
image bump-layer
060.
;
6
;propagate-mode
061.
;
1
;propagating-channel
062.
;
1
;propagating-rate
063.
;
15
;direction-mask
064.
;
0
;lower-limit
065.
;
255
;upper-limit
066.
; )
067.
; (gimp-selection-layer-alpha bump-layer) ;AlphaChanelをSelecdtionMaskに
068.
; (gimp-selection-shrink image
5
) ;縮小
069.
; (gimp-edit-clear bump-layer) ;選択範囲を削除
070.
071.
;テキストをパスに変換
072.
(gimp-selection-layer-alpha bump-layer) ;テキストを選択
073.
(plug-in-sel2path
1
image bump-layer) ;選択をパスに
074.
(gimp-selection-none image)
075.
(set! path-layer (car (gimp-layer-
new
image width height RGBA-IMAGE
"Path"
100
NORMAL-MODE)))
076.
(gimp-image-add-layer image path-layer -
1
) ;新規レイヤーpath-layerを追加
077.
(gimp-selection-all image)
078.
(gimp-edit-clear path-layer)
079.
(gimp-context-set-foreground fg-color)
080.
(gimp-context-set-brush
"Circle (05)"
)
081.
(gimp-path-stroke-current image)
082.
083.
(set! outline-layer (car(gimp-layer-copy path-layer
1
)))
084.
(gimp-image-add-layer image outline-layer
0
)
085.
086.
(gimp-drawable-set-visible bump-layer
0
)
087.
088.
(gimp-context-set-background bg-color) ;背景色を白に
089.
(gimp-selection-layer-alpha outline-layer) ;透明以外を選択
090.
(gimp-edit-blend outline-layer ;drawable
091.
FG-BG-RGB-MODE ;blend_mode
092.
NORMAL-MODE ;paint_mode
093.
GRADIENT-SHAPEBURST-SPHERICAL ;gradient_type
094.
100
;opacity
095.
0
;offset
096.
REPEAT-NONE ;repeat
097.
TRUE ;reverse
098.
FALSE ;supersample
099.
0
;max_depth(supersample)
100.
0
;threshold(supersample)
101.
TRUE ;dither
102.
width
103.
height
104.
(+ width
20
)
105.
height )
106.
(gimp-selection-none image) ;選択解除
107.
108.
(plug-in-bump-map
1
image outline-layer outline-layer
135
45
3
0
0
0
0
1
0
LINEAR )
109.
110.
(plug-in-gauss-iir2
1
image path-layer blur blur)
111.
(gimp-layer-set-offsets path-layer offset offset)
112.
113.
(gimp-selection-none image) ;選択なし
114.
(gimp-image-flatten image) ;画像統合
115.
);end of let*
116.
);end of define
117.
118.
(define (script-fu-
super
-logos01 text size fontname random blur offset)
119.
(let*
120.
(
121.
(img
0
)
122.
(text-layer
0
)
123.
)
124.
(set! img (car (gimp-image-
new
256
256
RGB)))
125.
(gimp-context-set-foreground '(
0
0
0
) )
126.
(set! text-layer (car (gimp-text-fontname img -
1
0
0
text
10
TRUE size PIXELS fontname)))
127.
(gimp-image-undo-disable img)
128.
(gimp-drawable-set-name text-layer text)
129.
(apply-
super
-logos01-effect img text-layer random blur offset) ;FONT EFFECT
130.
(gimp-image-undo-enable img)
131.
(gimp-display-
new
img)
132.
)
133.
)
134.
135.
(define
136.
(set-pt a index x y)
137.
(begin
138.
(aset a (* index
2
) x)
139.
(aset a (+ (* index
2
)
1
) y)
140.
)
141.
)
142.
143.
(script-fu-register
144.
"script-fu-super-logos01"
;Script name
145.
"<Toolbox>/Xtns/Script-Fu/Logos/super-logos01"
;Menu
146.
"Super Logos No.01 beta 0.1"
;Description
147.
"RETOUCH-SCRIPT"
;Creater
148.
"copyright 2006, RETOUCH-SCRIPT"
;copyright notice
149.
"Nov 01, 2006"
;date created
150.
""
151.
SF-STRING
"Text"
"GIMP 2.2"
152.
SF-ADJUSTMENT
"Font size (pixels)"
'(
100
2
1000
1
10
0
1
)
153.
SF-FONT
"Font"
"Cooper"
154.
SF-ADJUSTMENT
"Random seed"
'(
1000
0
2000
5
10
0
0
)
155.
SF-ADJUSTMENT
"Shadow blur"
'(
3
0
30
1
10
0
1
)
156.
SF-ADJUSTMENT
"Shadow offset"
'(
1
0
30
1
10
0
1
)
157.
158.
);end of register