; GIMP - The GNU Image Manipulation Program ; Copyright (C) 1995 Spencer Kimball and Peter Mattis ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ; ; ; Creates a highlighted blended text effect based on the steps found in ; gigatwo's blended text tutorial found here: ; http://www.gimpdome.com/forum/index.php?topic=6380.0 ; ; The script allows the user to use the current foreground/background ; colors or select new ones. The script also allows the user to ; set the final drop shadow color, offsets, blur, and opacity. There's ; also an option to use 3 different blend modes: FG-BG-RGB, FG-BG-HSV ; and FG-TRANSPARENT ; ; Just highlight the text layer and run the script, which is found on the ; Filters Menu > Alpha to Logo > Gigatwo's Text Blend... ; Define the Function (define (script-fu-gigs-text-blend image drawable useColor desiredForegroundColor desiredBackgroundColor customGradient blendMode offsetX offsetY blurRadius shadowColor opacity ) ;Declare the Variables (let* ( (theSelection) (originalLayer) (height) (originalLayerCopy) ) ; Set up the script so that user settings can be reset after the script is run (gimp-context-push) ; Start an Undo Group so script can be undone in one step (gimp-image-undo-group-start image) ; Set the active layer as the originalLayer (set! originalLayer (car (gimp-image-get-active-layer image))) ; Save any active selections to a channel so script can be run on whole layers and then turn off selection (set! theSelection (car (gimp-selection-save image))) (gimp-selection-none image) ; Make the originalLayer active and lock its Alpha Channel (gimp-image-set-active-layer image originalLayer) (gimp-layer-set-preserve-trans originalLayer TRUE) ; Set foreground/background colors based on user input. However, if the "Blend Mode "GRADIENT" is selected, the desired GIMP Gradient will be used as the fill. (if (= useColor FALSE) (begin (gimp-context-set-foreground desiredForegroundColor) (gimp-context-set-background desiredBackgroundColor) ) ) (if (= blendMode 3) (gimp-context-set-gradient customGradient) ) ; Get height of originalLayer for use in gradient blend, do gradient blend, Alpha select and invert selection. (set! height (car (gimp-drawable-height originalLayer))) (gimp-edit-blend originalLayer blendMode NORMAL-MODE GRADIENT-LINEAR 100 0 REPEAT-NONE FALSE FALSE 1 0 TRUE 0 0 0 height) (gimp-selection-layer-alpha originalLayer) (gimp-selection-invert image) ; Add white and then black inner drop shadows (script-fu-drop-shadow image originalLayer 0 2 2 '(255 255 255) 80 FALSE) (script-fu-drop-shadow image originalLayer 0 -2 2 '(0 0 0) 80 FALSE) ; Invert selection and then add a "final" drop shadow based on user input and deactivate selection. (gimp-selection-invert image) (script-fu-drop-shadow image originalLayer offsetX offsetY blurRadius shadowColor opacity FALSE) (gimp-selection-none image) ; Set originalLayer's blend mode to Hardlight and set turn the Alpha lock off (gimp-layer-set-mode originalLayer HARDLIGHT-MODE) (gimp-layer-set-preserve-trans originalLayer FALSE) ; Make copy of the originalLayer, add it to the image above the originalLayer ; Blur the layer and set its blend mode to Addition (set! originalLayerCopy (car (gimp-layer-copy originalLayer TRUE))) (gimp-image-add-layer image originalLayerCopy -1) (plug-in-gauss-iir2 RUN-NONINTERACTIVE image originalLayerCopy 30 30) (gimp-layer-set-mode originalLayerCopy ADDITION-MODE) ; Set originalLayer as the active layer and Alpha Select/Invert selection ; Then set the originalLayerCopy as active and delete the stuff outside ; The selection, then the selection is cleared. (gimp-image-set-active-layer image originalLayer) (gimp-selection-layer-alpha originalLayer) (gimp-selection-invert image) (gimp-image-set-active-layer image originalLayerCopy) (gimp-edit-clear originalLayerCopy) (gimp-selection-none image) ; The original selection is reloaded and its channel is deleted (gimp-selection-load theSelection) (gimp-image-remove-channel image theSelection) ; The originalLayer is again made active. (gimp-image-set-active-layer image originalLayer) ; Closes the undo group (gimp-image-undo-group-end image) ; Tells GIMP that a change has been made (gimp-displays-flush) ; Resets previous user settings (gimp-context-pop) ) ) ; Registers the Script with the PB (script-fu-register "script-fu-gigs-text-blend" "/Filters/Alpha to Logo/Gigatwo's Text Blend..." "Make a nice blended text" "Art Wade" "Art Wade" "2/12/2008" "RGB*" SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 SF-TOGGLE "Use Current Foreground & Background Colors?" FALSE SF-COLOR "Desired Foreground Color" '(255 180 0) SF-COLOR "Desired Background Color" '(60 134 196) SF-GRADIENT "Gradient Color" "Brushed Aluminium" SF-OPTION "Blend Mode" '("FG-BG-RGB" "FG-BG-HSV" "FG-TRANSPARENT" "GRADIENT") SF-ADJUSTMENT "Offset X" '(0 -4096 4096 1 10 0 1) SF-ADJUSTMENT "Offset Y" '(2 -4096 4096 1 10 0 1) SF-ADJUSTMENT "Blur radius" '(4 0 1024 1 10 0 1) SF-COLOR "Color" '(0 0 0) SF-ADJUSTMENT "Opacity" '(80 0 100 1 10 0 0) )