;;; ;;; invert.scm - lasm's color invert effect Version 1.0 ;;; ;;; ;;; lasm ;;; http://www.godsimmediatecontact.com ;;; http://www.godsdirectcontact.org ;;; ;;; ;;; Welcome to the Grandmother's Color Invert ;;; invert.scm - lasm's famous color invert script ;;; Dedication - to my mother (1917-2002) in loving memory ;;; ;;; -------------------------------------------------------------------- ;;; version 1.0 by Lasm 2002/02/20 ;;; - Initial relase ;;; version 1.0a by Raymond Ostertag 2004/09 ;;; - Changed menu entry ;;; -------------------------------------------------------------------- ;;; 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. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Grandmother's Color Invert:: ;;; Requires: ;;; This effect is fully reversible. ;;; Another quality script brought to you by the Grandmother Coffee House production. ;;; Created in the Special Palindrome Day of the century 20022002 ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (script-fu-invert img inLayer) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Helper function to create a new layer ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (copylayer layer layername) (set! new (car(gimp-layer-copy layer 1))) ; Add an alpha channel (gimp-layer-set-name new layername) new ) (let* ( (width (car (gimp-drawable-width inLayer))) (height (car (gimp-drawable-height inLayer))) (invert-layer (copylayer inLayer "Invert Layer")) (old-fg (car (gimp-palette-get-foreground))) (old-bg (car (gimp-palette-get-background))) ) (gimp-undo-push-group-start img) ;; Real work goes in here (gimp-image-add-layer img invert-layer -1) (gimp-invert inLayer) (gimp-layer-set-mode invert-layer HUE-MODE) ; Hue Layer Mode (gimp-layer-set-name (car (gimp-image-merge-down img invert-layer EXPAND-AS-NECESSARY)) "GM Color Invert") (gimp-undo-push-group-end img) (gimp-displays-flush) (gimp-palette-set-background old-bg) (gimp-palette-set-foreground old-fg) ) ) (script-fu-register "script-fu-invert" _"/Script-Fu/Alchemy/Color Invert" "Lasm's color invert effect. This works on any RGB image and the effect is reversible." "lasm" "Copyright 2002, lasm" "February 20, 2002" "RGB*" SF-IMAGE "The Image" 0 SF-DRAWABLE "The Layer" 0 )