
{"id":4135,"date":"2010-12-19T18:54:16","date_gmt":"2010-12-19T13:24:16","guid":{"rendered":"http:\/\/www.froisa.com\/?p=4135"},"modified":"2010-12-19T18:54:16","modified_gmt":"2010-12-19T13:24:16","slug":"fx-foundary-glowselection-gimp","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2010\/12\/19\/fx-foundary-glowselection-gimp\/","title":{"rendered":"fx-foundary + glowselection + gimp"},"content":{"rendered":"<pre>\n;\n; The GIMP -- an image manipulation program\n; Copyright (C) 1995 Spencer Kimball and Peter Mattis\n;\n; Selection glow script  for GIMP 2.4\n; Copyright (c) 1997 Adrian Likins\n; aklikins@eos.ncsu.ed\n;\n; Tags: glow, selection, effect\n;\n; Author statement:\n;  Makes a \"glow\" around the outside of the current selection\n;\n; Format Fixes for http:\/\/www.froisa.com\/ Jeffrin Jose\n; ahiliation@yahoo.co.in\n;\n;\n; --------------------------------------------------------------------\n; Distributed by Gimp FX Foundry project\n; --------------------------------------------------------------------\n;   - Changelog -\n;\n; Changed on June 15, 2000 by Kevin Cozens \n; Updated for GIMP 1.1.26\n;\n; Changed on January 29, 2004 by Kevin Cozens \n; Updated for GIMP 2.0pre3\n;\n; --------------------------------------------------------------------\n;\n; This program is free software; you can redistribute it and\/or modify\n; it under the terms of the GNU General Public License as published by\n; the Free Software Foundation; either version 2 of the License, or\n; (at your option) any later version.\n;\n; This program is distributed in the hope that it will be useful,\n; but WITHOUT ANY WARRANTY; without even the implied warranty of\n; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n; GNU General Public License for more details.\n;\n; You should have received a copy of the GNU General Public License\n; along with this program; if not, write to the Free Software\n; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n(define (my-pair-&gt;string pair)\n  (cons ((pair? (cdr pair))\n     (my-list-&gt;string pair))\n    (else\n     (print \"aoeuo\")\n     (string-append \"(\"   (to-string (car pair))\n            \" . \" (to-string (cdr pair)) \")\"))))\n\n(define (flatten-string-list str lst)\n  (cond ((not (null? lst))\n     (flatten-string-list (string-append str (car lst) \" \")\n                  (cdr lst)))\n    (else\n     str)))\n\n(define (my-list-&gt;string pair)\n  (let ((string-list (flatten-string-list \"\"\n              (map (lambda (x) (to-string x)) pair))))\n    (string-append \"(\" string-list \")\")))\n\n(define (to-string arg)\n  (cond ((number? arg)\n     (number-&gt;string arg))\n    ((string? arg)\n     arg)\n    ((symbol? arg)\n     \"  \")\n    ((pair? arg)\n     (my-pair-&gt;string arg))\n    (else\n     \"  \")))\n\n(define (message-box . args)\n  (gimp-message (apply string-append (map to-string args))))\n\n\n(define (script-fu-glow image\n            drawable\n            glow-radius\n            feather-radius\n            glow-color\n            glow-opacity\n            keep-selection)\n\n\n    (define seperate-layer TRUE)\n\n    (if (= (car (gimp-selection-is-empty image)) TRUE)\n    (begin\n; Message box line shortened for line limit for http:\/\/www.froisa.com\/\n      (message-box _\"The Script Works only with a selection.\"))\n    (begin\n      (define from-selection TRUE)\n      (define active-selection (car (gimp-selection-save image)))\n;Start an undo group so the process can be undone with one undo\n  (gimp-image-undo-group-start image)\n;Lets wait with the undo group untill we know if there is a selection.\n  (let* (\n     (type (car (gimp-drawable-type-with-alpha drawable)))\n     (old-gradient (car (gimp-context-get-gradient)))\n     (old-fg (car (gimp-context-get-foreground)))\n     (old-bg (car (gimp-context-get-background))))\n\n    (gimp-layer-add-alpha drawable)\n\n    (define selection-bounds (gimp-selection-bounds image))\n    (define select-offset-x (cadr selection-bounds))\n    (define select-offset-y (caddr selection-bounds))\n    (define select-width (- (cadr (cddr selection-bounds)) select-offset-x))\n    (define select-height (- (caddr (cddr selection-bounds)) select-offset-y))\n    (define buffer (+ (* glow-radius 2) (* feather-radius 2) 2))\n    (define select-height (+ select-height buffer))\n    (define select-width (+ select-width buffer))\n    (define select-offset-x (- select-offset-x (\/ buffer 2)))\n    (define select-offset-y (- select-offset-y (\/ buffer 2)))\n\n    (if (= seperate-layer TRUE)\n    (begin\n      (define effect-layer (car (gimp-layer-new image\n                          select-width\n                          select-height\n                          type\n                          _\"Glow Layer\"\n                          100\n                          NORMAL-MODE)))\n      (gimp-layer-set-offsets effect-layer select-offset-x select-offset-y)\n      (gimp-image-add-layer image effect-layer -1)\n      (gimp-selection-none image)\n      (gimp-edit-clear effect-layer)\n      (gimp-selection-load active-selection)\n      (gimp-image-set-active-layer image effect-layer ))\n    (begin\n      (gimp-edit-copy drawable)))\n    (define active-layer (car (gimp-image-get-active-layer image)))\n\n    (gimp-selection-grow image glow-radius)\n    (gimp-selection-feather image feather-radius)\n    (gimp-context-set-background glow-color)\n    (gimp-edit-fill active-layer BACKGROUND-FILL)\n\n    (if (= seperate-layer TRUE)\n    (begin\n      (gimp-selection-load active-selection)\n      (gimp-edit-clear active-layer)\n      (gimp-layer-set-opacity active-layer glow-opacity))\n    (begin\n      (gimp-selection-load active-selection)\n      (let ((floating-sel (car (gimp-edit-paste active-layer FALSE))))\n          (gimp-floating-sel-anchor floating-sel))\n      (gimp-selection-load active-selection)))\n\n    (gimp-context-set-gradient old-gradient)\n    (gimp-context-set-background old-bg)\n    (gimp-context-set-foreground old-fg)\n\n    (if (= keep-selection FALSE)\n    (gimp-selection-none image))\n\n    (gimp-image-set-active-layer image drawable)\n    (gimp-image-remove-channel image active-selection)\n\n;Finish the undo group for the process\n    (gimp-image-undo-group-end image)\n\n    (gimp-displays-flush)))\n    ))\n\n(script-fu-register \"script-fu-glow\"\n            _\"Glow Selection\"\n            _\"Makes a glow around the outside of the current selection.\"\n            \"Adrian Likins \"\n            \"Adrian Likins\"\n            \"10\/12\/97\"\n            \"RGB RGBA GRAY GRAYA\"\n            SF-IMAGE \"Image\" 0\n            SF-DRAWABLE \"Drawable\" 0\n            SF-VALUE _\"Glow Radius\" \"2\"\n            SF-VALUE _\"Feather Radius\" \"10\"\n            SF-COLOR _\"Glow Color\" '(255 255 255)\n            SF-VALUE _\"Glow Opacity (only for seperate layer)\" \"100\"\n            SF-TOGGLE _\"Keep Selection?\" TRUE)\n\n(script-fu-menu-register \"script-fu-glow\"\n                         \"\/FX-Foundry\/Selection Effects\")\n<\/pre>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/ahiliation\/5273318947\/\">http:\/\/www.flickr.com\/photos\/ahiliation\/5273318947\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>; ; The GIMP &#8212; an image manipulation program ; Copyright (C) 1995 Spencer Kimball and Peter Mattis ; ; Selection glow script for GIMP 2.4 ; Copyright (c) 1997 Adrian Likins ; aklikins@eos.ncsu.ed ; ; Tags: glow, selection, effect ; ; Author statement: ; Makes a &#8220;glow&#8221; around the outside of the current selection &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2010\/12\/19\/fx-foundary-glowselection-gimp\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;fx-foundary + glowselection + gimp&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/4135"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=4135"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/4135\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=4135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=4135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=4135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}