RSS/Atom feed Twitter
Site is read-only, email is disabled

list for script-fu-s

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

list for script-fu-s Gergely Kontra 07 Jun 20:31
  list for script-fu-s Joao S. O. Bueno 07 Jun 20:51
  list for script-fu-s Carol Spears 07 Jun 21:10
list for script-fu-s Gergely Kontra 10 Jun 18:49
Gergely Kontra
2004-06-07 20:31:48 UTC (almost 20 years ago)

list for script-fu-s

Hi!

Is there a separate list for gimp scripting, or should I ask script-fu related questions here?

thx
Gergo

Joao S. O. Bueno
2004-06-07 20:51:07 UTC (almost 20 years ago)

list for script-fu-s

On Monday 07 June 2004 15:31, Gergely Kontra wrote:

Hi!

Is there a separate list for gimp scripting, or should I ask script-fu related questions here?

thx
Gergo

There is a script-fu list in yahoogroups. But it has movement "0" - so you may ask your questions here, no problem.

The yahoogroups list is: script-fu@yahoogroups.com

Although, once when I needed some help, I sent a mail there, and they answered rather quickly.

Regards,
JS
->

Carol Spears
2004-06-07 21:10:30 UTC (almost 20 years ago)

list for script-fu-s

On Mon, Jun 07, 2004 at 08:31:48PM +0200, Gergely Kontra wrote:

Hi!

Is there a separate list for gimp scripting, or should I ask script-fu related questions here?

please do not ask to ask. Ask.

carol

Gergely Kontra
2004-06-10 18:49:30 UTC (almost 20 years ago)

list for script-fu-s

On 0607, Carol Spears wrote:

please do not ask to ask. Ask.

Ok. I tried to write a script based on this tutorial: http://gug.sunsite.dk/tutorials/ronq2/

The problem is how to use the Colors->Curves dialog. I cannot figure it out, so I used the paint tool :)

But I'm interested how can I script this. I want just a plain alpha-channel modification: (0 - 0)(255 - 64) points.

Here is my attempt (it works, but with the paint tool)

(define (set-pt a index x y) (prog1
(aset a (* index 2) x)
(aset a (+ (* index 2) 1) y)))

(define (script-fu-3d-plexi image layer objColor edge edgeInner shadowBlurRadius offsetX offsetY) (gimp-image-undo-group-start image) (let*
(
(old-fg (car (gimp-palette-get-foreground))) (old-selection (car (gimp-selection-save image))) (width (car (gimp-image-width image))) (height (car (gimp-image-height image))) ; the new layers
(bumpMapLayer (car (gimp-layer-new image width height RGBA-IMAGE "BumpMap" 100 NORMAL-MODE))) (shadowLayer (car (gimp-layer-new image width height RGBA-IMAGE "Shadow" 100 NORMAL-MODE))) (shadowLayerMask 0)
(plexiLayer 0)
(myAlpha (cons-array 4 'byte))
; the shadow and the object color is the invert in RGB space (shadowColor (list (- 255 (car objColor)) (- 255 (cadr objColor)) (- 255 (caddr objColor)))) )
(set-pt myAlpha 0 0 0)
(set-pt myAlpha 1 255 64)
; clear the new layers
(gimp-selection-all image)
(gimp-edit-fill bumpMapLayer TRANSPARENT-FILL) ;(gimp-image-add-layer image bumpMapLayer -1) (gimp-edit-fill shadowLayer TRANSPARENT-FILL) (gimp-image-add-layer image shadowLayer -1) ; make a selection from the layer's alpha channel (gimp-selection-layer-alpha layer) ; fill it with white
(gimp-palette-set-foreground '(255 255 255)) (gimp-edit-fill bumpMapLayer FOREGROUND-FILL) ; create shadow shape
(gimp-palette-set-foreground shadowColor) (gimp-edit-fill shadowLayer FOREGROUND-FILL) ; blur the bumpmap
(gimp-selection-none image)
(plug-in-gauss-rle 1 image bumpMapLayer 5 TRUE TRUE) ; the bumpmap...
(plug-in-bump-map 1 image shadowLayer bumpMapLayer 135 25 4 0 0 0 0 0 0 0) ;no need for the bumpmap layer anymore (gimp-drawable-delete bumpMapLayer) ; select the shape...
(gimp-selection-layer-alpha layer) ; except the edge
(gimp-selection-shrink image (+ edge edgeInner)) ; but to get a smooth transition (if needed...) (gimp-selection-feather image edgeInner) ; make the shadow translucent
;(gimp-curves-spline shadowLayer HISTOGRAM-ALPHA 4 myAlpha) (set! shadowLayerMask (car (gimp-layer-create-mask shadowLayer ADD-ALPHA-MASK))) (gimp-layer-add-mask shadowLayer shadowLayerMask) (gimp-palette-set-foreground '(0 0 0)) (gimp-edit-bucket-fill shadowLayerMask FG-BUCKET-FILL NORMAL-MODE 75 255 FALSE 0 0) (gimp-layer-remove-mask shadowLayer MASK-APPLY) ; copy the shadow layer
(set! plexiLayer (car (gimp-layer-new-from-drawable shadowLayer image))) (gimp-layer-set-name plexiLayer "Plexi") (gimp-image-add-layer image plexiLayer -1) (gimp-selection-clear image) ; clear the selection (it is on the shadow layer) (gimp-selection-none image)
; invert (back) the plexi colors (gimp-invert plexiLayer)
; blur the shadow
(plug-in-gauss-rle 1 image shadowLayer shadowBlurRadius TRUE TRUE) ; and move the shadow
(gimp-drawable-offset shadowLayer FALSE OFFSET-TRANSPARENT offsetX offsetY) ; set the shadow mode
(gimp-layer-set-mode shadowLayer MULTIPLY-MODE) ; restoring things...
(gimp-palette-set-foreground old-fg) (gimp-selection-load old-selection) (gimp-image-remove-channel image old-selection) (gimp-image-remove-layer image layer) (gimp-image-undo-group-end image) (gimp-displays-flush)
)
)
(script-fu-register
"script-fu-3d-plexi" ;func name _"/Script-Fu/Alpha to Logo/3D Ple_xi" ;location "Creates 3D plexi object with drop shadow" ;description "Gergely Kontra" ;author "Based on Ron Scott's Transparent objects tutorial";copyright notice " May 23, 2004" ;date/revision "RGBA" ;Image type that the script works o SF-IMAGE "The image" 0
SF-DRAWABLE "The active layer" 0
SF-COLOR _"Object Color" '(0 128 255) ;a color variable SF-ADJUSTMENT _"Outline Size" '(2 0 20 1 1 0 1) SF-ADJUSTMENT _"Opacity fade blur" '(2 0 10 0.1 0.1 2 1) SF-ADJUSTMENT _"Shadow Blur Radius" '(10 0 250 1 1 0 1) SF-ADJUSTMENT _"Shadow X Offset" '(10 -100 100 1 1 0 1) SF-ADJUSTMENT _"Shadow Y Offset" '(10 -100 100 1 1 0 1) )