; 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. ; ; Copyright (C) 2005 Francois Le Lay ; ; Version 0.1 (define (script-fu-lomo aimg adraw) (let* ((img (car (gimp-drawable-get-image adraw))) (owidth (car (gimp-image-width img))) (oheight (car (gimp-image-height img))) (vignette (car (gimp-layer-new img owidth oheight 1 "Vignette-Layer" 100 OVERLAY-MODE))) (tunnel (car (gimp-layer-new img owidth oheight 1 "Tunnel-Layer" 80 OVERLAY-MODE))) ) (gimp-context-push) (gimp-image-undo-group-start img) (gimp-brightness-contrast adraw 0 20) (gimp-hue-saturation adraw ALL-HUES 0 0 20) (gimp-image-add-layer img tunnel -1) (gimp-image-add-layer img vignette -1) (gimp-drawable-fill tunnel TRANSPARENT-FILL) (gimp-selection-all img) (gimp-selection-shrink img 50 ) (gimp-selection-feather img 100 ) (gimp-image-set-active-layer img vignette) (gimp-drawable-fill vignette TRANSPARENT-FILL) (gimp-layer-set-preserve-trans vignette 0) (gimp-selection-invert img) (gimp-context-set-foreground '(0 0 0)) (gimp-context-set-background '(255 255 255)) (gimp-bucket-fill vignette 0 0 100 0 0 0 0) (gimp-image-set-active-layer img tunnel) (gimp-layer-set-preserve-trans tunnel 0) (gimp-selection-none img) (gimp-context-swap-colors) (gimp-edit-blend tunnel 2 0 2 100 0 REPEAT-NONE FALSE FALSE 0 0 TRUE (/ owidth 2) (/ oheight 2) owidth (/ oheight 2)) (gimp-image-undo-group-end img) (gimp-displays-flush) (gimp-context-pop) ) ) (script-fu-register "script-fu-lomo" _"Lomo..." "Do a lomo effect on image" "Francois Le Lay " "Francois Le Lay" "15/02/05" "*" SF-IMAGE "Input image" 0 SF-DRAWABLE "Input drawable" 0) (script-fu-menu-register "script-fu-lomo" _"/Script-Fu/Utils")