On... Gradients.
So here's what I found out about gradients in script-fu....
1.) create an image and display it.
(define image(gimp-image-new 512 512 0))
(gimp-display-new (car image))
2.) define a new layer as a variable, and add it to your image.
(define gradLayer (gimp-layer-new (car image) 512 512 0 "gradLayer" 100 0))
(gimp-image-add-layer (car image) (car gradLayer) -1)
3.) define the active drawable of your image
(define ad (gimp-image-get-active-drawable (car image)))
4.) add a default gradient to your drawable
(gimp-edit-blend (car ad) 0 0 0 100 0 0 FALSE TRUE 4 3 TRUE 0 0 (car (gimp-drawable-width (car ad))) (car (gimp-drawable-height (car ad))))
The param's of gimp-edit-blend, in order, are as follows:
drawable, blend-mode (I chose FG-BG-RBG), paint-mode (I chose normal), gradient-type (linear), opacity, offset, repeat (none), reverse, super-sample, max-depth, threshold, dither, x1 (0), y1 (0), x2 (drawable width), y2 (drawable height).
Phew! That should display a nice little gradient in whatever colors you have set as your fg/bg colors in GIMP. Sweet.
0 comments:
Post a Comment