; Fire Logo v2.00 September 30, 2004 ; by Kevin Cozens ; ; Creates an image with text which looks like the text is on fire. ; This script is based on the PhotoFlame instructions given at ; http://www.rashkie.com/sal/pflame/pflame.html ; The GIMP -- an 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. ; ;March 9, 1999 Kevin Cozens ;Fire Logo v1.03 ; ;June 15, 2000 Kevin Cozens ;Updated for GIMP 1.1.26 ; ;May 4, 2005 Kevin Cozens ;Add layer to image before calling gimp-layer-resize-to-image-size ;Layer with text is now labeled "Text" and will always be in black (define (apply-fire-effect img fire-layer size transparent) (let* ( (width (car (gimp-drawable-width fire-layer))) (height (car (gimp-drawable-height fire-layer))) (text-layer (car (gimp-layer-copy fire-layer FALSE))) (bg-layer (car (gimp-layer-new img width height RGB-IMAGE "Background" 100 NORMAL-MODE))) ) ; Set Colormap v1.2 May 4, 2005 ; by Kevin Cozens (define (script-fu-make-cmap-array palette) (let* ( (num-colours (gimp-palette-get-info palette)) (cmap (cons-array (* num-colours 3) 'byte)) (colour) (i 0) ) (while (< i num-colours) (set! colour (car (gimp-palette-entry-get-color palette i))) (aset cmap (* i 3) (car colour)) (aset cmap (+ (* i 3) 1) (cadr colour)) (aset cmap (+ (* i 3) 2) (caddr colour)) (set! i (+ i 1)) ) cmap ) ) (define (script-fu-set-cmap img drawable palette) (gimp-image-set-cmap img (* (gimp-palette-get-info palette) 3) (script-fu-make-cmap-array palette)) (gimp-displays-flush) ) (gimp-context-push) (gimp-image-undo-disable img) (gimp-context-set-background '(0 0 0)) (gimp-context-set-foreground '(255 255 255)) (if (> (car (gimp-layer-get-mask fire-layer)) -1) (gimp-layer-remove-mask fire-layer MASK-APPLY) ) (gimp-selection-layer-alpha fire-layer) (gimp-edit-bucket-fill fire-layer FG-BUCKET-FILL NORMAL-MODE 100 0 0 0 0) (gimp-selection-none img) (gimp-image-resize img width (* height 2) 0 height) (gimp-image-add-layer img bg-layer 4) (gimp-layer-resize-to-image-size bg-layer) (gimp-drawable-fill bg-layer BACKGROUND-FILL) (set! fire-layer (car (gimp-image-merge-visible-layers img CLIP-TO-IMAGE))) (gimp-drawable-set-name fire-layer "Fire") (gimp-image-add-layer img text-layer -1) (gimp-drawable-set-name text-layer "Text") (gimp-layer-set-offsets text-layer 0 height) (gimp-selection-layer-alpha text-layer) (gimp-edit-bucket-fill text-layer BG-BUCKET-FILL NORMAL-MODE 100 0 0 0 0) (gimp-selection-none img) (plug-in-rotate 1 img fire-layer 3 TRUE) (plug-in-wind 1 img fire-layer 10 1 (/ size 12) 1 1) (plug-in-rotate 1 img fire-layer 1 TRUE) (plug-in-spread 1 img fire-layer (/ size 10) (/ size 20)) (plug-in-gauss-iir 1 img fire-layer 3.5 1 1) (plug-in-ripple 1 img fire-layer (/ size 4) 1 0 0 1 TRUE FALSE) (gimp-image-convert-indexed img NO-DITHER MAKE-PALETTE 256 FALSE FALSE "") (script-fu-set-cmap img fire-layer "Firecode") (gimp-image-convert-rgb img) (if (= transparent TRUE) (plug-in-colortoalpha RUN-NONINTERACTIVE img fire-layer '(0 0 0)) ) (set! fire-layer (car (gimp-image-merge-visible-layers img CLIP-TO-IMAGE))) (plug-in-autocrop RUN-NONINTERACTIVE img fire-layer) (gimp-display-new img) (gimp-image-undo-enable img) (gimp-context-pop) ) ) (define (script-fu-fire-logo text size font transparent) (let* ( (img (car (gimp-image-new 256 256 RGB))) (fire-layer (car (gimp-text-fontname img -1 0 0 text 10 TRUE size PIXELS font))) (width (car (gimp-drawable-width fire-layer))) (height (car (gimp-drawable-height fire-layer))) ) (gimp-image-resize img width height 0 0) (apply-fire-effect img fire-layer size transparent) ) ) (define (script-fu-fire-image img fire-layer transparent) (if (= (car (gimp-image-get-layers img)) 1) (apply-fire-effect img fire-layer (car (gimp-drawable-height fire-layer)) transparent) (gimp-display-message _"Fire: Needs only one layer with a transparency.") ) ) (script-fu-register "script-fu-fire-logo" _"/Xtns/Script-Fu/Logos/Fire" "Creates an image with text which looks like the text is on fire" "Kevin Cozens " "Kevin Cozens" "September 30, 2004" "" SF-TEXT _"Text" "Fire" SF-ADJUSTMENT _"Font size (pixels)" '(100 2 1000 1 10 0 1) SF-FONT _"Font" "Futura Poster" SF-TOGGLE _"Transparent background" FALSE ) (script-fu-register "script-fu-fire-image" _"/Script-Fu/Alpha to Logo/Fire" "Alters an image on a transparent background to make it look like it is on fire." "Kevin Cozens " "Kevin Cozens" "September 30, 2004" "GRAY* INDEXED*" SF-IMAGE _"Image" 0 SF-DRAWABLE _"Drawable" 0 SF-TOGGLE _"Transparent background" FALSE )