³æ¨B°õ¦æslime2.scm

 

        ©Ó±µ¡u½Æ»s¤@­ÓScript-Fuµ{¦¡¡Gslime2.scm¡v¤@¤å¡C§ó¶i¤@¨B¨ÓÁA¸ÑScript_Fu¡C

¤@¡Bslime2.scmµ{¦¡½X¡G

1: (define (script-fu-slime-logo2 text size font)

2:   (let* ((img (car (gimp-image-new 256 256 RGB)))

3:         (text-layer (car (gimp-text-fontname img -1 0 0 text 30 TRUE size PIXELS font)))

4:         (width (car (gimp-drawable-width text-layer)))

5:         (height (* (car (gimp-drawable-height text-layer)) 1.3))

6:        (layer1 (car (gimp-layer-new img width height RGBA_IMAGE "Back" 100 NORMAL))))

7:

²Ä1¦æ

 

 

 

 

 

²Ä7¦æ

8:  ;; put the text white

9:    (gimp-invert text-layer)

10: ;; put the background black

11:     (gimp-palette-set-background '(0 0 0))

12:     (gimp-image-add-layer img layer1 1)

13:     (gimp-edit-fill layer1 FG-IMAGE-FILL)

14: ;; Resize the image

15:    (gimp-image-resize img width height 0 0)

16: ;; merge the text and the bg

17:    (set! sboub (car (gimp-image-merge-down img text-layer 0)))

18: ;; rotate the image from 90 degress

19:    (plug-in-rotate 1 img sboub 1 TRUE)

20: ;; put some wind

21:    (plug-in-wind 1 img sboub 10 1 8 1 1)

22: ;; rotate back

23:    (plug-in-rotate 1 img sboub 3 TRUE)

24: ;; wave it

25:    (plug-in-waves 1 img sboub 4 0 50 0 0)

26: ;; blur

27:    (plug-in-gauss-iir 1 img sboub 5 1 1)

28: ;; change the color to give the slime

29:    (gimp-color-balance sboub 0 1 -100 0 -100)

30:    (gimp-color-balance sboub 2 1 100 0 10)

31: ;; display

32:    (gimp-display-new img)))

33:

34:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

²Ä30¦æ

35: (script-fu-register "script-fu-slime-logo2"

36:                     "<Toolbox>/Xtns/Script-Fu/Logos/Slime2"

37:                     "Slime yourself..."

38:

39:                     "Jean-Philippe Turcat (cmrjpt@soc.staffs.ac.uk)"

40:                     "Jean-Philippe Turcat"

41:                     "08/06/1999"

42:                     ""

43:                     SF-STRING "Text String" "Gimp"

44:                     SF-ADJUSTMENT "Font Size (pixels)" '(72 2 1000 1 10 0 1)

45:                     SF-FONT "Font" "-*-ComicsCarToon-*-r-*-*-24-*-*-*-p-*-*-*")

²Ä35¦æ

²Ä36¦æ

 

¤G¡B³æ¨B°õ¦æ¡G

¤@¯ëComplier³£¦³³æ¨B°õ¦æÅý§Ú­Ì¯à¤@¦¸¤@¦æ¦a°õ¦æµ{¦¡¡B°lÂÜ¿ù»~¡C¥i±¤¨S¦³¤H¬°Scheme»y¨¥µo®i§ó¦nªº°£¿ù¤u¨ã¡C

¥H¤U§Ú¥Î«Ü­ì©lªº¤èªk¡A§e²{slime2.scm³o­Óscript_fu°õ¦æªº¾ã­Ó¬yµ{¡C

³z¹L³o­Ó¤èªk§A·|§óÁA¸Ñ³o­Óµ{¦¡¡C

²Ä1¦æ¨ì²Ä6¦æ

 

l          ¨Ï¥Î¤å¦r½s¿è¾¹­×§ïslime2.scmÀÉ

l          §R°£slime2.scmµ{¦¡½X²Ä7¦æ¨ì²Ä30¦æ¡AÀx¦sÀɮסC

l          «O¯d²Ä32¦æªº¥Øªº¬O¬°¤F°õ¦æscript«á¡A¯à¦³¹Ï¤ùµøµ¡¨q¥X¨Ó¡C

l          ­YÁÙ¥¼°õ¦æGimpµ{¦¡¡A½Ð±Ò°ÊGimpµ{¦¡¡C

l          ­Y§A¤w°õ¦æGimpµ{¦¡¡A°õ¦æ[Gimp] -> Xtrns -> Script-Fu -> Refresh¡A§ó·sGimpªºµ{§Ç¸ê®Æ®w¤ºªº¸ê®Æ¡C

l          °õ¦æ[Gimp] -> Xtrns -> Script-Fu -> Logos -> Slime2·|²£¥Í¥k¹Ï¡C

l          2: (let* ((img (car (gimp-image-new 256 256 RGB)))

²£¥Í·s¼v¹³¤j¤p¬°256x256¡BRGB¼Ò¦¡¡A±N·s¼v¹³¦s¦bimgÅܼƤº¡C

l          3:(text-layer (car (gimp-text-fontname img -1 0 0 text 30 TRUE size PIXELS font)))

    ²£¥Í·s¤å¦r¹Ï¼h¡A±N·s¤å¦r¹Ï¼h¦s¦btext-layerÅܼƤº¡C

l          4: (width (car (gimp-drawable-width text-layer)))

¨Ï¥Îgimp-drawable-width±o¨ì¤å¦r¹Ï¼hªº¼e«×¨Ã¦s¦bwidthÅܼƤº¡C

l          5: (height (* (car (gimp-drawable-height text-layer)) 1.3))

    ¨Ï¥Îgimp-drawable-height±o¨ì¤å¦r¹Ï¼hªº°ª«×¡A±N°ª«×­¼¥H1.3­¿¨Ã¦s¦bheightÅܼƤº¡C

l          6:(layer1 (car (gimp-layer-new img width height RGBA_IMAGE "Back" 100 NORMAL))))

²£¥Í¤@­Ó¦W¬°Backªº¹Ï¼h¡A¦s¦blayer1ÅܼƤº¡C

±Ò°Ê¹Ï¼h¹ï¸Ü®Ø·|µo²{¥u¦³¤@­ÓText Layer¹Ï¼h¡A¨S¦³Back¹Ï¼h¡A¬O¦]¬°¥²¶·¨ì¤F²Ä12¦æ(gimp-image-add-layer img layer1 1)«á¡ABack¹Ï¼h¤~·|¥[¨ìimg¼v¹³¤W¡C

ª`·N¡G

(let* (  )

    (  )

    ¡K¡K

)

l          ±q²Ä2¦æ¨ì²Ä32¦æ¡A¾ã­Óµ{¦¡³Q¥]¦b(let*  )¨ç¦¡ªº¬A¸¹¤º

l          img¡Btext-layer¡Bwidth¡Bheight¡Blayer1³o¨Ç°Ï°ìÅܼƪº¨Ï¥Î½d³ò¥u¨ì²Ä32¦æ¤§«e¡C

7¡B8¡B9¦æ

l          ¨Ï¥Î¤å¦r½s¿è¾¹­×§ïslime2.scmÀÉ

l          ­ì¥»§Ú¤w§R°£slime2.scmµ{¦¡½X²Ä7¦æ¨ì²Ä30¦æ¡A²{¦b¥[¤W7¡B8¡B9¦æ¡AÀx¦sÀɮסC

l          °õ¦æ[Gimp] -> Xtrns -> Script-Fu -> Refresh¡A§ó·sGimpªºµ{§Ç¸ê®Æ®w¤ºªº¸ê®Æ¡C

l          °õ¦æ[Gimp] -> Xtrns -> Script-Fu -> Logos -> Slime2·|²£¥Í¥k¹Ï¡C

l          9: (gimp-invert text-layer)

±N¶Â¦â¦rªºGimp¤ÏÂàÃC¦â¬°¥Õ¦â¦rªºGimp¡C

10¡B11¡B12¡B13¦æ

l          ¨Ï¥Î¤å¦r½s¿è¾¹­×§ïslime2.scmÀÉ

l          ¥[¤W10¡B11¡B12¡B13¦æ¡AÀx¦sÀɮסC

l          °õ¦æ[Gimp] -> Xtrns -> Script-Fu -> Refresh¡C

l          °õ¦æ[Gimp] -> Xtrns -> Script-Fu -> Logos -> Slime2¡C

 

l          10: ;; put the background black

l          11: (gimp-palette-set-background '(0 0 0))

l          12: (gimp-image-add-layer img layer1 1)

l          13: (gimp-edit-fill layer1 FG-IMAGE-FILL)

¥i¯à§A¤]·|ı±o¤£¥i«äij¡A§â¤@­Ó¹Ï¼h¶î¦¨¶Â¦â³ºµM­n3­Ó¨BÆJ¡C

§O§Ñ¤F§â¤j¶H©ñ¨ì¦B½c¤]­n3­Ó¨BÆJ¡C

 

l          °õ¦æ(gimp-image-add-layer img layer1 1)«á¡Aimg¼v¹³«K¦³¨â­Ó¹Ï¼h¤F¡C

14¡B15¦æ

l          ¥[¤W14¡B15¦æ¡AÀx¦sÀɮסC

l          °õ¦æ[Gimp] -> Xtrns -> Script-Fu -> Refresh¡C

l          °õ¦æ[Gimp] -> Xtrns -> Script-Fu -> Logos -> Slime2¡C

l          15: (gimp-image-resize img width height 0 0)

¬Ý¹Ï´Nª¾¹D³o¤@¦æ¬O°µ¤°»ò¥Îªº¡I

§â¹ÏÁY¤p¡C

16¡B17¦æ

l          ¥[¤W16¡B17¦æ¡AÀx¦sÀɮסC

l          °õ¦æ[Gimp] -> Xtrns -> Script-Fu -> Refresh¡C

l          °õ¦æ[Gimp] -> Xtrns -> Script-Fu -> Logos -> Slime2¡C

l          set!¬O¥Î¨Ó«Å§i¼s°ìÅܼƪº¨ç¦¡¡C

l          17: (set! sboub (car (gimp-image-merge-down img text-layer 0)))

±Nimg¼v¹³¤ºªº¹Ï¼h¦X¨Ö¡A¦X¨Ö«áªº¹Ï¼h©R¬°sboubÅܼơC

 

 

l          ¹Ï¼h¦X¨Ö«á¡A¥u³ÑBack¹Ï¼h

 

18¦æ¨ì32¦æ¡G

¥H¤U§Ú­Ì­«½Æ¤U¦C¤T­Ó°Ê§@¡A¤@ª½¨ì³Ì«á¥[¤J²Ä32¦æ¡C

l          ¥[¤W²ÄX¡BY¦æ¡AÀx¦sÀɮסC

l          °õ¦æ[Gimp] -> Xtrns -> Script-Fu -> Refresh¡C

l          °õ¦æ[Gimp] -> Xtrns -> Script-Fu -> Logos -> Slime2¡C

 

18¡B19¦æ

(plug-in-rotate 1 img sboub 1TRUE)

¼v¹³³Q±ÛÂà90«×¡C

20¡B21¦æ

(plug-in-wind 1 img sboub 10 1 8 1 1)

»s§@­·§jªº®ÄªG

22¡B23¦æ

22: ;; rotate back

23: (plug-in-rotate 1 img sboub 3 TRUE)

Âà¦^¨Ó

24¡B25¦æ

24: ;; wave it

25: (plug-in-waves 1 img sboub 4 0 50 0 0)

»s³y¤ôªiªº®ÄªG

26¡B27¦æ

26: ;; blur

27: (plug-in-gauss-iir 1 img sboub 5 1 1)

»s³y¼Ò½kªº®ÄªG

Gaussian Blur(iir)¡A¼Ò½k¥b®|5 pixels¡C

 

28¡B29¦æ

28:;; change the color to give the slime

29: (gimp-color-balance sboub 0 1 -100 0 -100)

¼W¥[·t³¡³±¼v¡]shadows¡^³Bªº«C¦â¡]cyna¡^ªºµ{«×¨ì³Ì¤j­È100¡A¼W¥[·t³¡³±¼v¡]shadows¡^³Bªº¶À¡]yellow¡^ªºµ{«×¨ì³Ì¤j­È100¡C

30¦æ

30:(gimp-color-balance sboub 2 1 100 0 10)

¼W¥[«G³¡¡]highlights¡^³Bªº¬õ¦â¡]red¡^ªºµ{«×¨ì³Ì¤j­È100¡A¼W¥[«G³¡¡]highlights¡^³BªºÂŦâ¡]blue¡^ªºµ{«×10¡C

¡]¥H¤W¤º®e¬O®Ú¾ÚDB Browserªº¸ê®Æ©Ò±À½×ªº¡^

 

¤T¡B¯à¦A¸ÑÄÀ²M·¡¤@ÂI¶Ü¡H

      ¦b¥»¤å¤¤¡A³\¦h¨ç¼Æªº¥\¯à¨S¦³¸ÑÄÀ²M·¡¡A¨ç¼Æªº°Ñ¼Æ¦p¦ó³]©w§¹¥þ¨S¦³¸ÑÄÀ¡C¤@¤Áªºµª®×³£¦bDB Browser¤º¡C

        ¥H¤U¥Hgimp-color-balance¨ç¼Æ¬°¨Ò¤l¡C

DB Browser¹ï¸Ü²°ªº¤@³¡¤À

l          °õ¦æ[Gimp] -> DB Browser¡A

l          ¬d¸ßgimp-color-balance³o¨ç¼Æ

 

 

°õ¦æ¨ì²Ä29¦æ©Ò²£¥Íªº¼v¹³

l          ¹ï¡A°õ¦æ[image] ->Colors -> Color Balance¡A²£¥ÍColor Balance¹ï¸Ü²°¡C

Color Balance¹ï¸Ü²°

l          ®Ú¾ÚDB Browser¹ï¸Ü²°©Ò¬d¨ìªº¸ê®Æ¡A(gimp-color-balance sboub 2 1 100 0 10)

¦U°Ñ¼Æªº·N«ä¬°¡G

²Ä1­Ó°Ñ¼Æsboub¡Aªí¥Ü±ý°õ¦æcolor balance¥\¯àªº¹Ï¼hªº¦W¦r¡C

²Ä2­Ó°Ñ¼Æ2¡Aªí¥ÜHighlight¼Ò¦¡¡C

²Ä3­Ó°Ñ¼Æ1¡Aªí¥ÜPreserve Luminosty¡C

²Ä4¡B5¡B6­Ó°Ñ¼Æ100 0 10¡Aªí¥Ücyna-red¡Bmagenta-green¡Byellow-blue¤T­ÓColor Levelsªº­È³]¬° 100 0 10¡C

l          ®Ú¾Ú¤W­±ªº±À´ú¡A³]©wColor Balance¹ï¸Ü²°ªº°Ñ¼Æ¦p¥ª¹Ï¡C

l          «ö¤UColor Balance¹ï¸Ü²°OK«ö¶s¡A±o¨ì¥ª¹Ï¡C

l          ¼W¥[«G³¡¡]highlight¡^ªº¬õÃC¦âªº¶q¨ì100¡AÂÅÃC¦âªº¶q¨ì10¡C

 

        ­Y­n¦A§óÁA¸Ñ¡A¥u¦³¾a¦Û¤v¤F¡C¥[ªo¡I¡I