Added new scripts and new gradients they need.

--Sven
This commit is contained in:
Sven Neumann 1998-05-12 22:21:08 +00:00
parent 155981ac9b
commit adce2c53d0
17 changed files with 1387 additions and 0 deletions

View File

@ -1,3 +1,13 @@
Wed May 13 00:03:18 MEST 1998
* added nine new scripts from Chris Gutteridge
(asc2img.scm, camo.scm, coffee.scm, distress_selection.scm,
fuzzyborder.scm, old_photo.scm, rendermap.scm
spinning_globe.scm, tileblur.scm)
* added two gradients that are used by the new scripts
(Coffee, Land_and_Sea)
Tue May 12 02:49:12 PDT 1998 Manish Singh <yosh@gimp.org>
* app/app_procs.c: create tips dialog after loading files on the

3
data/gradients/Coffee Normal file
View File

@ -0,0 +1,3 @@
GIMP Gradient
1
0.000000 0.949917 1.000000 0.560606 0.435893 0.311332 0.000000 0.300000 0.233262 0.166605 1.000000 4 0

View File

@ -0,0 +1,7 @@
GIMP Gradient
5
0.000000 0.081803 0.166945 1.000000 1.000000 1.000000 1.000000 0.560606 0.560606 0.560606 1.000000 0 0
0.166945 0.212020 0.265442 0.560606 0.560606 0.560606 1.000000 0.083243 0.462121 0.112054 1.000000 0 0
0.265442 0.378965 0.390651 0.083243 0.462121 0.112054 1.000000 1.000000 0.988739 0.298904 1.000000 0 0
0.390651 0.400668 0.459098 1.000000 0.988739 0.298904 1.000000 0.529502 0.586235 1.000000 1.000000 0 0
0.459098 0.507513 1.000000 0.529502 0.586235 1.000000 1.000000 0.019021 0.108157 0.590909 1.000000 0 0

View File

@ -26,6 +26,7 @@ FILES =\
CD \
CD_Half \
Caribbean_Blues \
Coffee \
Cold_Steel \
Cold_Steel_2 \
Crown_molding \
@ -57,6 +58,7 @@ FILES =\
Horizon_2 \
Incandescent \
Land_1 \
Land_and_Sea \
Metallic_Something \
Mexican_flag \
Mexican_flag_smooth \

View File

@ -12,6 +12,7 @@ scriptdata_DATA = \
alien-glow-bullet.scm \
alien-glow-button.scm \
alien-glow-logo.scm \
asc2img.scm \
basic1-logo.scm \
basic2-logo.scm \
beavis.jpg \
@ -24,6 +25,7 @@ scriptdata_DATA = \
blend-anim.scm \
blended-logo.scm \
bovinated-logo.scm \
camo.scm \
carve-it.scm \
carved-logo.scm \
chalk.scm \
@ -32,17 +34,20 @@ scriptdata_DATA = \
chrome-logo.scm \
circuit.scm \
clothify.scm \
coffee.scm \
color-cycling.scm \
comic-logo.scm \
coolmetal-logo.scm \
copy-visible.scm \
crystal-logo.scm \
distress_selection.scm \
drop-shadow.scm \
egg.scm \
erase-rows.scm \
flatland.scm \
font-map.scm \
frosty-logo.scm \
fuzzy_border.scm \
gimp-headers.scm \
gimp-labels.scm \
glossy.scm \
@ -56,10 +61,12 @@ scriptdata_DATA = \
land.scm \
lava.scm \
line-nova.scm \
old_photo.scm \
mkbrush.scm \
neon-logo.scm \
perspective-shadow.scm \
predator.scm \
rendermap.scm \
ripply-anim.scm \
round-corners.scm \
select_to_brush.scm \
@ -68,6 +75,7 @@ scriptdata_DATA = \
slide.scm \
sota-chrome-logo.scm \
sphere.scm \
spinning_globe.scm \
starburst-logo.scm \
starscape-logo.scm \
swirltile.scm \
@ -80,6 +88,7 @@ scriptdata_DATA = \
texture3.jpg \
textured-logo.scm \
title-header.scm \
tileblur.scm \
trochoid.scm \
truchet.scm \
unsharp-mask.scm \

View File

@ -0,0 +1,270 @@
; Chris Gutteridge / ECS Dept. University of Southampton, England
; "ASCII 2 Image" script for the Gimp.
;
; 8th April 1998
;
; Takes a filename of an ASCII file and converts it to a gimp image.
; Does sensible things to preserve indents (gimp-text strips them)
;
; cjg@ecs.soton.ac.uk
; 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.
; Define the function:
(define (script-fu-asc-2-img inFile
inFont
inFontSize
inTextColor
inTrans
inBackColor
inBufferAmount
inFlatten)
(set! theImage (car (gimp-image-new 10 10 RGB) ) )
(set! theLayer (car (gimp-layer-new theImage
10
10
RGBA_IMAGE
"layer 1"
100
NORMAL) ) )
(gimp-palette-set-background inBackColor)
(gimp-layer-set-name theLayer "Background")
(gimp-image-add-layer theImage theLayer 0)
(script-fu-asc-2-img-layer theImage theLayer inFile inFont inFontSize
inTextColor inBufferAmount inFlatten)
(set! theBuffer (* inFontSize (/ inBufferAmount 100) ) )
(set! theImageWidth (+ theImageWidth theBuffer theBuffer ))
(set! theImageHeight (+ theImageHeight theBuffer theBuffer ))
(gimp-image-resize theImage
theImageWidth
theImageHeight
theBuffer
theBuffer)
(gimp-layer-resize theLayer
theImageWidth
theImageHeight
theBuffer
theBuffer)
(gimp-selection-all theImage)
(if (= inTrans TRUE)
(gimp-edit-clear theImage theLayer)
(gimp-edit-fill theImage theLayer)
)
(gimp-selection-none theImage)
(if (= inFlatten TRUE)
(gimp-image-merge-visible-layers theImage 0)
()
)
(gimp-display-new theImage)
(gimp-image-clean-all theImage)
(gimp-displays-flush)
(cons theImage () )
)
(define (script-fu-asc-2-img-layer inImage
inLayer
inFile
inFont
inFontSize
inTextColor
inFlatten)
(set! theImage inImage)
(set! theLayer inLayer)
(set! theFile (fopen inFile))
(set! otherLayers (cadr (gimp-image-get-layers theImage)))
(set! nLayers (car (gimp-image-get-layers theImage)))
(set! n nLayers)
(if (= inFlatten TRUE)
(while (> n 0) (set! n (- n 1)) (gimp-layer-set-visible (aref otherLayers n) FALSE) )
()
)
(gimp-palette-set-foreground inTextColor)
(gimp-selection-none theImage)
(set! theData ())
(set! theIndentList ())
(set! theChar "X")
(while (not (equal? () theChar))
(set! allspaces TRUE)
(set! theIndent 0)
(set! theLine "")
(while (begin (set! theChar (fread 1 theFile))
(and (not (equal? "\n" theChar))
(not (equal? () theChar))
)
)
(cond ( (equal? theChar "\t")
(set! theChar " ")
(if (= allspaces TRUE)
(set! theIndent (+ theIndent 8))
())
)
( (equal? theChar " ")
(if (= allspaces TRUE)
(set! theIndent (+ theIndent 1))
())
)
(TRUE (set! allspaces FALSE))
)
(set! theLine (string-append theLine theChar))
)
(if (= allspaces TRUE)
(set! theLine "")
()
)
(if (and (equal? () theChar)
(equal? "" theLine)
)
()
(begin (set! theData (cons theLine theData))
(set! theIndentList
(cons theIndent theIndentList))
)
)
)
(set! theText (car (gimp-text theImage
-1
0
0
"X"
0
TRUE
inFontSize
PIXELS
"*"
inFont
"*"
"*"
"*"
"*")))
(set! theCharWidth (car (gimp-drawable-width theText) ))
(gimp-edit-cut theImage theText)
(set! theImageHeight 0)
(set! theImageWidth 0)
(cjg-add-text (reverse theData)
(reverse theIndentList)
inFont
inFontSize)
(if (= inFlatten TRUE)
(gimp-image-merge-visible-layers theImage 0)
()
)
(set! n nLayers)
(if (= inFlatten TRUE)
(while (> n 0) (set! n (- n 1)) (gimp-layer-set-visible (aref otherLayers n) TRUE) )
()
)
(gimp-displays-flush)
)
(define (cjg-add-text inData inIndentList inFont inFontSize)
(if (equal? () inData)
()
(let ((theLine (car inData)) (theIndent (car inIndentList)))
(if (equal? "" theLine)
()
(begin
(set! theText (car (gimp-text theImage
-1
0
0
(string-append " " theLine)
0
TRUE
inFontSize
PIXELS
"*"
inFont
"*"
"*"
"*"
"*")))
(set! theLineHeight (car (gimp-drawable-height theText) ) )
(gimp-layer-set-offsets theText
(* theCharWidth theIndent)
(+ theImageHeight
(- inFontSize theLineHeight)))
(set! theImageWidth (max
(+ (car (gimp-drawable-width theText) )
(* theCharWidth theIndent))
theImageWidth ))
(if (= (car (gimp-layer-is-floating-sel theText)) TRUE)
(gimp-floating-sel-anchor theText)
()
)
(gimp-layer-set-name theText theLine)
)
)
(set! theImageHeight
(+ theImageHeight inFontSize))
(cjg-add-text (cdr inData) (cdr inIndentList) inFont inFontSize)))
)
; Register the function with the GIMP:
(script-fu-register
"script-fu-asc-2-img"
"<Toolbox>/Xtns/Script-Fu/Utils/ASCII 2 Image"
"foo"
"Chris Gutteridge: cjg@ecs.soton.ac.uk"
"8th April 1998"
"Chris Gutteridge / ECS @ University of Southampton, England"
"bar"
SF-VALUE "File Name:" "\"afile\""
SF-VALUE "Font:" "\"Charter\""
SF-VALUE "Font size:" "45"
SF-COLOR "Text Color:" '(0 0 0)
SF-TOGGLE "Transparent BG?" FALSE
SF-COLOR "Background Color:" '(255 255 255)
SF-VALUE "Buffer amount (% height of text):" "35"
SF-TOGGLE "Flatten Image?" TRUE
)
(script-fu-register
"script-fu-asc-2-img-layer"
"<Image>/Script-Fu/Utils/ASCII 2 Image Layer"
"foo"
"Chris Gutteridge: cjg@ecs.soton.ac.uk"
"30th April 1998"
"Chris Gutteridge / ECS @ University of Southampton, England"
"bar"
SF-IMAGE "Image" 0
SF-DRAWABLE "Layer" 0
SF-VALUE "File Name:" "\"afile\""
SF-VALUE "Font:" "\"Charter\""
SF-VALUE "Font size:" "45"
SF-COLOR "Text Color:" '(0 0 0)
SF-TOGGLE "Flatten Image?" TRUE
)

View File

@ -0,0 +1,101 @@
;
;
;
; Chris Gutteridge (cjg@ecs.soton.ac.uk)
; At ECS Dept, University of Southampton, England.
; 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.
(define (script-fu-camo-pattern inSize inGrain inColor1 inColor2 inColor3 inSmooth inFlatten)
(set! old-bg (car (gimp-palette-get-background)))
(set! theWidth inSize)
(set! theHeight inSize)
(set! theImage (car(gimp-image-new theWidth theHeight RGB)))
(set! baseLayer (car (gimp-layer-new theImage theWidth theHeight RGBA_IMAGE "Background" 100 NORMAL)))
(gimp-image-add-layer theImage baseLayer 0)
(set! thickLayer (car (gimp-layer-new theImage theWidth theHeight RGBA_IMAGE "Camo Thick Layer" 100 NORMAL)))
(gimp-image-add-layer theImage thickLayer 0)
(set! thinLayer (car (gimp-layer-new theImage theWidth theHeight RGBA_IMAGE "Camo Thin Layer" 100 NORMAL)))
(gimp-image-add-layer theImage thinLayer 0)
(gimp-selection-all theImage)
(gimp-palette-set-background inColor1)
(gimp-drawable-fill baseLayer BG-IMAGE-FILL)
(plug-in-solid-noise TRUE theImage thickLayer 1 0 (rand 65536) 1 inGrain inGrain)
(plug-in-solid-noise TRUE theImage thinLayer 1 0 (rand 65536) 1 inGrain inGrain)
(gimp-threshold theImage thickLayer 127 255)
(gimp-threshold theImage thinLayer 145 255)
(set! theBlur (- 16 inGrain))
(gimp-palette-set-background inColor2)
(gimp-by-color-select theImage thickLayer '(0 0 0) 127 REPLACE TRUE FALSE 0 FALSE)
(gimp-edit-clear theImage thickLayer)
(gimp-selection-invert theImage)
(gimp-edit-fill theImage thickLayer)
(gimp-selection-none theImage)
(if (= inSmooth TRUE)
(script-fu-tile-blur theImage thickLayer theBlur TRUE TRUE FALSE)
()
)
(gimp-palette-set-background inColor3)
(gimp-by-color-select theImage thinLayer '(0 0 0) 127 REPLACE TRUE FALSE 0 FALSE)
(gimp-edit-clear theImage thinLayer)
(gimp-selection-invert theImage)
(gimp-edit-fill theImage thinLayer)
(gimp-selection-none theImage)
(if (= inSmooth TRUE)
(script-fu-tile-blur theImage thinLayer (/ theBlur 2) TRUE TRUE FALSE)
()
)
(if (= inFlatten TRUE)
(gimp-image-flatten theImage)
()
)
(gimp-palette-set-background old-bg)
(gimp-display-new theImage)
)
; Register the function with the GIMP:
(script-fu-register
"script-fu-camo-pattern"
"<Toolbox>/Xtns/Script-Fu/Patterns/Camouflage"
"foo"
"Chris Gutteridge: cjg@ecs.soton.ac.uk"
"28th April 1998"
"Chris Gutteridge / ECS @ University of Southampton, England"
""
SF-VALUE "Image Size:" "256"
SF-VALUE "Granularity (0 - 15):" "7"
SF-COLOR "Color 1:" '(33 100 58)
SF-COLOR "Color 2:" '(170 170 60)
SF-COLOR "Color 3:" '(150 115 100)
SF-TOGGLE "Smooth?" FALSE
SF-TOGGLE "Flatten?" TRUE
)

View File

@ -0,0 +1,69 @@
;
;
;
; Chris Gutteridge (cjg@ecs.soton.ac.uk)
; At ECS Dept, University of Southampton, England.
; 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.
(define (script-fu-coffee-stain inImage inLayer inNumber inDark)
(set! theImage inImage)
(set! theHeight (car (gimp-image-height theImage)))
(set! theWidth (car (gimp-image-width theImage)))
(set! theNumber inNumber)
(set! theSize (min theWidth theHeight) )
(while (> theNumber 0)
(set! theNumber (- theNumber 1))
(set! theStain (car (gimp-layer-new theImage theSize theSize RGBA_IMAGE "Stain" 100
(if (= inDark TRUE) DARKEN-ONLY NORMAL) )))
(gimp-image-add-layer theImage theStain 0)
(gimp-selection-all theImage)
(gimp-edit-clear theImage theStain)
(let ((blobSize (/ (rand (- theSize 40)) (+ (rand 3) 1) ) ) )
(gimp-ellipse-select theImage
(/ (- theSize blobSize) 2)
(/ (- theSize blobSize) 2)
blobSize blobSize REPLACE TRUE 0 FALSE)
)
(script-fu-distress-selection theImage theStain (* (+ (rand 15) 1) (+ (rand 15) 1)) (/ theSize 25) 4 2 TRUE TRUE )
(gimp-gradients-set-active "Coffee")
(gimp-blend theImage theStain CUSTOM NORMAL SHAPEBURST-DIMPLED 100 0 REPEAT-NONE FALSE 0 0 0 0 0 0)
(gimp-layer-set-offsets theStain (- (rand theWidth) (/ theSize 2)) (- (rand theHeight) (/ theSize 2)) theSize)
)
(gimp-selection-none theImage)
(gimp-displays-flush)
)
; Register the function with the GIMP:
(script-fu-register
"script-fu-coffee-stain"
"<Image>/Script-Fu/Decor/Coffee Stain"
"foo"
"Chris Gutteridge"
"1998, Chris Gutteridge / ECS dept, University of Southampton, England."
"25th April 1998"
"RGBA RGB"
SF-IMAGE "The Image" 0
SF-DRAWABLE "The Layer" 0
SF-VALUE "Stains:" "3"
SF-TOGGLE "Darken Only: (better but only for images with alot of white)" TRUE
)

View File

@ -0,0 +1,105 @@
;
; distress selection
;
;
; Chris Gutteridge (cjg@ecs.soton.ac.uk)
; At ECS Dept, University of Southampton, England.
; 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.
; Define the function:
(define (script-fu-distress-selection inImage
inLayer
inThreshold
inSpread
inGranu
inSmooth
inSmoothH
inSmoothV
)
(set! theImage inImage)
(set! theWidth (car (gimp-image-width inImage)))
(set! theHeight (car (gimp-image-height inImage)))
(gimp-image-disable-undo theImage)
(set! theLayer (car (gimp-layer-new theImage
theWidth
theHeight
RGBA_IMAGE
"Distress Scratch Layer"
100
NORMAL
) ) )
(gimp-image-add-layer theImage theLayer 0)
(if (= TRUE (car (gimp-selection-is-empty theImage)))
()
(gimp-edit-fill theImage theLayer)
)
(gimp-selection-invert theImage)
(if (= TRUE (car (gimp-selection-is-empty theImage)))
()
(gimp-edit-clear theImage theLayer)
)
(gimp-selection-invert theImage)
(gimp-selection-none inImage)
(gimp-layer-scale theLayer
(/ theWidth inGranu)
(/ theHeight inGranu)
TRUE
)
(plug-in-spread TRUE
theImage
theLayer
inSpread
inSpread
)
(plug-in-gauss-iir TRUE theImage theLayer inSmooth inSmoothH inSmoothV)
; (plug-in-gauss-iir TRUE theImage theLayer 2 TRUE TRUE)
(gimp-layer-scale theLayer theWidth theHeight TRUE)
(plug-in-threshold-alpha TRUE theImage theLayer inThreshold)
(plug-in-gauss-iir TRUE theImage theLayer 1 TRUE TRUE)
(gimp-selection-layer-alpha theImage theLayer)
(gimp-image-remove-layer theImage theLayer)
; (gimp-layer-delete theLayer)
(gimp-image-enable-undo theImage)
(gimp-displays-flush)
)
; Register the function with the GIMP:
(script-fu-register
"script-fu-distress-selection"
"<Image>/Script-Fu/Selection/Distress Selection"
"foo"
"Chris Gutteridge"
"1998, Chris Gutteridge / ECS dept, University of Southampton, England."
"23rd April 1998"
"RGB RGBA"
SF-IMAGE "The Image" 0
SF-DRAWABLE "The Layer" 0
SF-VALUE "Threshold: bigger 1<-->255 smaller" "127"
SF-VALUE "Spread:" "8"
SF-VALUE "Granularity: (1 is low)" "4"
SF-VALUE "Smooth" "2"
SF-TOGGLE "Smooth Horizontally" TRUE
SF-TOGGLE "Smooth Vertically" TRUE
)

View File

@ -0,0 +1,105 @@
;
; distress selection
;
;
; Chris Gutteridge (cjg@ecs.soton.ac.uk)
; At ECS Dept, University of Southampton, England.
; 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.
; Define the function:
(define (script-fu-distress-selection inImage
inLayer
inThreshold
inSpread
inGranu
inSmooth
inSmoothH
inSmoothV
)
(set! theImage inImage)
(set! theWidth (car (gimp-image-width inImage)))
(set! theHeight (car (gimp-image-height inImage)))
(gimp-image-disable-undo theImage)
(set! theLayer (car (gimp-layer-new theImage
theWidth
theHeight
RGBA_IMAGE
"Distress Scratch Layer"
100
NORMAL
) ) )
(gimp-image-add-layer theImage theLayer 0)
(if (= TRUE (car (gimp-selection-is-empty theImage)))
()
(gimp-edit-fill theImage theLayer)
)
(gimp-selection-invert theImage)
(if (= TRUE (car (gimp-selection-is-empty theImage)))
()
(gimp-edit-clear theImage theLayer)
)
(gimp-selection-invert theImage)
(gimp-selection-none inImage)
(gimp-layer-scale theLayer
(/ theWidth inGranu)
(/ theHeight inGranu)
TRUE
)
(plug-in-spread TRUE
theImage
theLayer
inSpread
inSpread
)
(plug-in-gauss-iir TRUE theImage theLayer inSmooth inSmoothH inSmoothV)
; (plug-in-gauss-iir TRUE theImage theLayer 2 TRUE TRUE)
(gimp-layer-scale theLayer theWidth theHeight TRUE)
(plug-in-threshold-alpha TRUE theImage theLayer inThreshold)
(plug-in-gauss-iir TRUE theImage theLayer 1 TRUE TRUE)
(gimp-selection-layer-alpha theImage theLayer)
(gimp-image-remove-layer theImage theLayer)
; (gimp-layer-delete theLayer)
(gimp-image-enable-undo theImage)
(gimp-displays-flush)
)
; Register the function with the GIMP:
(script-fu-register
"script-fu-distress-selection"
"<Image>/Script-Fu/Selection/Distress Selection"
"foo"
"Chris Gutteridge"
"1998, Chris Gutteridge / ECS dept, University of Southampton, England."
"23rd April 1998"
"RGB RGBA"
SF-IMAGE "The Image" 0
SF-DRAWABLE "The Layer" 0
SF-VALUE "Threshold: bigger 1<-->255 smaller" "127"
SF-VALUE "Spread:" "8"
SF-VALUE "Granularity: (1 is low)" "4"
SF-VALUE "Smooth" "2"
SF-TOGGLE "Smooth Horizontally" TRUE
SF-TOGGLE "Smooth Vertically" TRUE
)

View File

@ -0,0 +1,167 @@
;
; fuzzy-border
;
; Do a cool fade to a given colour at the border of an image (optional shadow)
; Will make image RGB if it isn't already.
;
; Chris Gutteridge (cjg@ecs.soton.ac.uk)
; At ECS Dept, University of Southampton, England.
; 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.
; Define the function:
(define (script-fu-fuzzy-border inImage
inLayer
inColor
inSize
inBlur
inGranu
inShadow
inShadWeight
inCopy
inFlatten
)
(gimp-selection-all inImage)
(set! theImage (if (= inCopy TRUE)
(car (gimp-channel-ops-duplicate inImage))
inImage)
)
(if (> (car (gimp-drawable-type inLayer))
1
)
(gimp-convert-rgb theImage)
)
(set! theWidth (car (gimp-image-width inImage)))
(set! theHeight (car (gimp-image-height inImage)))
(set! theLayer (car (gimp-layer-new theImage
theWidth
theHeight
RGBA_IMAGE
"layer 1"
100
NORMAL
) ) )
(gimp-image-add-layer theImage theLayer 0)
(gimp-edit-clear theImage theLayer)
(chris-color-edge theImage theLayer inColor inSize)
(gimp-layer-scale theLayer
(/ theWidth inGranu)
(/ theHeight inGranu)
TRUE
)
(plug-in-spread TRUE
theImage
theLayer
(/ inSize inGranu)
(/ inSize inGranu)
)
(chris-color-edge theImage theLayer inColor 1)
(gimp-layer-scale theLayer theWidth theHeight TRUE)
(gimp-selection-layer-alpha theImage theLayer)
(gimp-selection-invert theImage)
(gimp-edit-clear theImage theLayer)
(gimp-selection-invert theImage)
(gimp-edit-clear theImage theLayer)
(gimp-palette-set-background inColor)
(gimp-edit-fill theImage theLayer)
(gimp-selection-none inImage)
(chris-color-edge theImage theLayer inColor 1)
(if (= inBlur TRUE)
(plug-in-gauss-rle TRUE theImage theLayer inSize TRUE TRUE)
()
)
(if (= inShadow FALSE)
()
(begin
(gimp-selection-none inImage)
(gimp-image-add-layer theImage
(car (gimp-layer-copy theLayer
FALSE
))
0
)
(gimp-layer-scale theLayer (- theWidth inSize) (- theHeight inSize) TRUE)
(gimp-desaturate theImage theLayer)
(gimp-brightness-contrast theImage theLayer 127 127)
(gimp-invert theImage theLayer)
(gimp-layer-resize theLayer
theWidth
theHeight
(/ inSize 2)
(/ inSize 2)
)
(plug-in-gauss-rle TRUE
theImage
theLayer
(/ inSize 2)
TRUE
TRUE
)
(gimp-layer-set-opacity theLayer inShadWeight)
)
)
(if (= inFlatten TRUE)
(gimp-image-flatten theImage)
()
)
(if (= inCopy TRUE)
(begin (gimp-image-clean-all theImage)
(gimp-display-new theImage)
)
()
)
(gimp-displays-flush)
)
(define (chris-color-edge inImage inLayer inColor inSize)
(gimp-selection-all inImage)
(gimp-selection-shrink inImage inSize)
(gimp-selection-invert inImage)
(gimp-palette-set-background inColor)
(gimp-edit-fill theImage theLayer)
(gimp-selection-none inImage)
)
; Register the function with the GIMP:
(script-fu-register
"script-fu-fuzzy-border"
"<Image>/Script-Fu/Decor/Fuzzy Border"
"foo"
"Chris Gutteridge"
"1998, Chris Gutteridge / ECS dept, University of Southampton, England."
"3rd April 1998"
"RGB RGBA GRAY GRAYA"
SF-IMAGE "The Image" 0
SF-DRAWABLE "The Layer" 0
SF-COLOR "Color:" '(255 255 255)
SF-VALUE "Border Size:" "16"
SF-TOGGLE "Blur Border?" TRUE
SF-VALUE "Granularity: (1 is low)" "4"
SF-TOGGLE "Add Shadow?" FALSE
SF-VALUE "Shadow-Weight (%):" "100"
SF-TOGGLE "Work on Copy?" TRUE
SF-TOGGLE "Flatten Layers?" TRUE
)

View File

@ -0,0 +1,95 @@
;
; old-photo
;
;
; Chris Gutteridge (cjg@ecs.soton.ac.uk)
; At ECS Dept, University of Southampton, England.
; 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.
; Define the function:
(define (script-fu-old-photo inImage inLayer inDefocus inBorder inSepia inMottle inCopy)
(gimp-selection-all inImage)
(set! theImage (if (= inCopy TRUE)
(car (gimp-channel-ops-duplicate inImage))
inImage)
)
(set! theLayer (car(gimp-image-flatten theImage)))
(if (= inDefocus TRUE)
(plug-in-gauss-rle TRUE theImage theLayer 1.5 TRUE TRUE)
()
)
(if (= inBorder TRUE)
(script-fu-fuzzy-border theImage inLayer '(255 255 255)
20 TRUE 8 FALSE 100 FALSE TRUE )
()
)
(set! theLayer (car(gimp-image-flatten theImage)))
(if (= inSepia TRUE)
(begin (gimp-desaturate theImage theLayer)
(gimp-brightness-contrast theImage theLayer -20 -40)
(gimp-color-balance theImage theLayer 0 TRUE 30 0 -30)
)
()
)
(set! theWidth (car (gimp-image-width theImage)))
(set! theHeight (car (gimp-image-height theImage)))
(if (= inMottle TRUE)
(begin (set! mLayer (car (gimp-layer-new theImage theWidth theHeight RGBA_IMAGE "Mottle" 100 DARKEN-ONLY)))
(gimp-image-add-layer theImage mLayer 0)
(gimp-selection-all theImage)
(gimp-edit-clear theImage mLayer)
(gimp-selection-none theImage)
(plug-in-noisify TRUE theImage mLayer TRUE 0 0 0 0.5)
(plug-in-gauss-rle TRUE theImage mLayer 5 TRUE TRUE)
(set! theLayer (car(gimp-image-flatten theImage)))
)
()
)
(if (= inCopy TRUE)
(begin (gimp-image-clean-all theImage)
(gimp-display-new theImage)
)
()
)
(gimp-selection-none inImage)
(gimp-displays-flush theImage)
)
; Register the function with the GIMP:
(script-fu-register
"script-fu-old-photo"
"<Image>/Script-Fu/Decor/Old Photo"
"foo"
"Chris Gutteridge"
"1998, Chris Gutteridge / ECS dept, University of Southampton, England."
"16th April 1998"
"RGB RGBA GRAY GRAYA"
SF-IMAGE "The Image" 0
SF-DRAWABLE "The Layer" 0
SF-TOGGLE "Defocus?" TRUE
SF-TOGGLE "Border?" TRUE
SF-TOGGLE "Sepia?" TRUE
SF-TOGGLE "Mottle?" FALSE
SF-TOGGLE "Work on Copy?" TRUE
)

View File

@ -0,0 +1,95 @@
;
; old-photo
;
;
; Chris Gutteridge (cjg@ecs.soton.ac.uk)
; At ECS Dept, University of Southampton, England.
; 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.
; Define the function:
(define (script-fu-old-photo inImage inLayer inDefocus inBorder inSepia inMottle inCopy)
(gimp-selection-all inImage)
(set! theImage (if (= inCopy TRUE)
(car (gimp-channel-ops-duplicate inImage))
inImage)
)
(set! theLayer (car(gimp-image-flatten theImage)))
(if (= inDefocus TRUE)
(plug-in-gauss-rle TRUE theImage theLayer 1.5 TRUE TRUE)
()
)
(if (= inBorder TRUE)
(script-fu-fuzzy-border theImage inLayer '(255 255 255)
20 TRUE 8 FALSE 100 FALSE TRUE )
()
)
(set! theLayer (car(gimp-image-flatten theImage)))
(if (= inSepia TRUE)
(begin (gimp-desaturate theImage theLayer)
(gimp-brightness-contrast theImage theLayer -20 -40)
(gimp-color-balance theImage theLayer 0 TRUE 30 0 -30)
)
()
)
(set! theWidth (car (gimp-image-width theImage)))
(set! theHeight (car (gimp-image-height theImage)))
(if (= inMottle TRUE)
(begin (set! mLayer (car (gimp-layer-new theImage theWidth theHeight RGBA_IMAGE "Mottle" 100 DARKEN-ONLY)))
(gimp-image-add-layer theImage mLayer 0)
(gimp-selection-all theImage)
(gimp-edit-clear theImage mLayer)
(gimp-selection-none theImage)
(plug-in-noisify TRUE theImage mLayer TRUE 0 0 0 0.5)
(plug-in-gauss-rle TRUE theImage mLayer 5 TRUE TRUE)
(set! theLayer (car(gimp-image-flatten theImage)))
)
()
)
(if (= inCopy TRUE)
(begin (gimp-image-clean-all theImage)
(gimp-display-new theImage)
)
()
)
(gimp-selection-none inImage)
(gimp-displays-flush theImage)
)
; Register the function with the GIMP:
(script-fu-register
"script-fu-old-photo"
"<Image>/Script-Fu/Decor/Old Photo"
"foo"
"Chris Gutteridge"
"1998, Chris Gutteridge / ECS dept, University of Southampton, England."
"16th April 1998"
"RGB RGBA GRAY GRAYA"
SF-IMAGE "The Image" 0
SF-DRAWABLE "The Layer" 0
SF-TOGGLE "Defocus?" TRUE
SF-TOGGLE "Border?" TRUE
SF-TOGGLE "Sepia?" TRUE
SF-TOGGLE "Mottle?" FALSE
SF-TOGGLE "Work on Copy?" TRUE
)

View File

@ -0,0 +1,74 @@
;
;
;
; Chris Gutteridge (cjg@ecs.soton.ac.uk)
; At ECS Dept, University of Southampton, England.
; 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.
(define (script-fu-render-map inSize inGrain inGrad inWiden)
(set! theWidth inSize)
(set! theHeight inSize)
(set! theImage (car(gimp-image-new theWidth theHeight RGB)))
(gimp-selection-all theImage)
(set! theLayer (car (gimp-layer-new theImage theWidth theHeight RGBA_IMAGE "I've got more rubber ducks than you!" 100 NORMAL)))
(gimp-image-add-layer theImage theLayer 0)
(plug-in-solid-noise TRUE theImage theLayer 1 0 (rand 65536) inGrain inGrain inGrain)
(if (= inWiden TRUE) (begin
(set! thinLayer (car (gimp-layer-new theImage theWidth theHeight RGBA_IMAGE "Camo Thin Layer" 100 NORMAL)))
(gimp-image-add-layer theImage thinLayer 0)
(let ((theBigGrain (min 15 (* 2 inGrain))))
(plug-in-solid-noise TRUE theImage thinLayer 1 0 (rand 65536) theBigGrain theBigGrain theBigGrain)
)
(gimp-palette-set-background '(255 255 255))
(gimp-palette-set-foreground '(0 0 0))
(let ((theMask (car(gimp-layer-create-mask thinLayer 0))))
(gimp-image-add-layer-mask theImage thinLayer theMask)
(gimp-blend theImage theMask FG-BG-RGB NORMAL LINEAR 100
0 REPEAT-TRIANGULAR FALSE 0 0 0 0 0 (/ theHeight 2) )
)
(set! theLayer (car(gimp-image-flatten theImage)))
))
(gimp-selection-none theImage)
(gimp-gradients-set-active inGrad)
(plug-in-gradmap TRUE theImage theLayer)
(gimp-display-new theImage)
)
; Register the function with the GIMP:
(script-fu-register
"script-fu-render-map"
"<Toolbox>/Xtns/Script-Fu/Patterns/Render Map"
"foo"
"Chris Gutteridge: cjg@ecs.soton.ac.uk"
"28th April 1998"
"Chris Gutteridge / ECS @ University of Southampton, England"
""
SF-VALUE "Image Size:" "256"
SF-VALUE "Granularity (0 - 15):" "4"
SF-VALUE "Gradient:" "\"Land_and_Sea\""
SF-TOGGLE "TRUE = Detail in middle, FALSE = tile" FALSE
)

View File

@ -0,0 +1,99 @@
;
; anim_sphere
;
;
; Chris Gutteridge (cjg@ecs.soton.ac.uk)
; At ECS Dept, University of Southampton, England.
; 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.
; Define the function:
(define (script-fu-spinning-globe inImage inLayer inFrames inFromLeft inTransparent inIndex inCopy)
(set! theImage (if (= inCopy TRUE)
(car (gimp-channel-ops-duplicate inImage))
inImage)
)
(set! theLayer (car(gimp-image-get-active-layer theImage)))
(gimp-layer-add-alpha theLayer)
(set! n 0)
(set! ang (* (/ 360 inFrames) (if (= inFromLeft TRUE) 1 -1) ))
(while (> inFrames n)
(set! n (+ n 1))
(set! theFrame (car (gimp-layer-copy theLayer FALSE)))
(gimp-image-add-layer theImage theFrame 0)
(gimp-layer-set-name theFrame (string-append "Anim Frame: " (number->string (- inFrames n) 10)))
(plug-in-map-object TRUE theImage theFrame 1
;viewpoint
0.5 0.5 2.0
;obj pos?
0.5 0.5 0
;first axis
1.0 0 0
;2nd axis
0.0 1.0 0.0
; axis rotation
0 (* n ang) 0
; light
0 '(255 255 255)
; light pos
-0.5 -0.5 2.0
; light dir
-1.0 -1.0 1.0
; amb and stuff
.3 1 .5 0 27
TRUE FALSE FALSE inTransparent 0.25)
; end while:
)
(gimp-image-remove-layer theImage theLayer)
(plug-in-autocrop TRUE theImage theFrame)
(if (= inIndex 0)
()
(gimp-convert-indexed theImage TRUE inIndex)
)
(if (= inCopy TRUE)
(begin (gimp-image-clean-all theImage)
(gimp-display-new theImage)
)
()
)
(gimp-displays-flush)
)
; Register the function with the GIMP:
(script-fu-register
"script-fu-spinning-globe"
"<Image>/Script-Fu/Animators/Spinning Globe"
"foo"
"Chris Gutteridge"
"1998, Chris Gutteridge / ECS dept, University of Southampton, England."
"16th April 1998"
"RGB RGBA GRAY GRAYA"
SF-IMAGE "The Image" 0
SF-DRAWABLE "The Layer" 0
SF-VALUE "Frames:" "10"
SF-TOGGLE "Turn from left to right?" FALSE
SF-TOGGLE "Transparant Background?" TRUE
SF-VALUE "Index of n Colors (0 = Remain RGB):" "63"
SF-TOGGLE "Work on Copy?" TRUE
)

View File

@ -0,0 +1,99 @@
;
; anim_sphere
;
;
; Chris Gutteridge (cjg@ecs.soton.ac.uk)
; At ECS Dept, University of Southampton, England.
; 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.
; Define the function:
(define (script-fu-spinning-globe inImage inLayer inFrames inFromLeft inTransparent inIndex inCopy)
(set! theImage (if (= inCopy TRUE)
(car (gimp-channel-ops-duplicate inImage))
inImage)
)
(set! theLayer (car(gimp-image-get-active-layer theImage)))
(gimp-layer-add-alpha theLayer)
(set! n 0)
(set! ang (* (/ 360 inFrames) (if (= inFromLeft TRUE) 1 -1) ))
(while (> inFrames n)
(set! n (+ n 1))
(set! theFrame (car (gimp-layer-copy theLayer FALSE)))
(gimp-image-add-layer theImage theFrame 0)
(gimp-layer-set-name theFrame (string-append "Anim Frame: " (number->string (- inFrames n) 10)))
(plug-in-map-object TRUE theImage theFrame 1
;viewpoint
0.5 0.5 2.0
;obj pos?
0.5 0.5 0
;first axis
1.0 0 0
;2nd axis
0.0 1.0 0.0
; axis rotation
0 (* n ang) 0
; light
0 '(255 255 255)
; light pos
-0.5 -0.5 2.0
; light dir
-1.0 -1.0 1.0
; amb and stuff
.3 1 .5 0 27
TRUE FALSE FALSE inTransparent 0.25)
; end while:
)
(gimp-image-remove-layer theImage theLayer)
(plug-in-autocrop TRUE theImage theFrame)
(if (= inIndex 0)
()
(gimp-convert-indexed theImage TRUE inIndex)
)
(if (= inCopy TRUE)
(begin (gimp-image-clean-all theImage)
(gimp-display-new theImage)
)
()
)
(gimp-displays-flush)
)
; Register the function with the GIMP:
(script-fu-register
"script-fu-spinning-globe"
"<Image>/Script-Fu/Animators/Spinning Globe"
"foo"
"Chris Gutteridge"
"1998, Chris Gutteridge / ECS dept, University of Southampton, England."
"16th April 1998"
"RGB RGBA GRAY GRAYA"
SF-IMAGE "The Image" 0
SF-DRAWABLE "The Layer" 0
SF-VALUE "Frames:" "10"
SF-TOGGLE "Turn from left to right?" FALSE
SF-TOGGLE "Transparant Background?" TRUE
SF-VALUE "Index of n Colors (0 = Remain RGB):" "63"
SF-TOGGLE "Work on Copy?" TRUE
)

View File

@ -0,0 +1,77 @@
;
;
;
; Chris Gutteridge (cjg@ecs.soton.ac.uk)
; At ECS Dept, University of Southampton, England.
; 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.
(define (script-fu-tile-blur inImage inLayer inRadius inHoriz inVert inType)
(set! theImage inImage)
(set! theLayer inLayer)
(set! theHeight (car (gimp-drawable-height theLayer)))
(set! theWidth (car (gimp-drawable-width theLayer)))
(gimp-image-disable-undo theImage)
(gimp-layer-resize theLayer (* 3 theWidth) (* 3 theHeight) 0 0)
(gimp-rect-select theImage 0 0 theWidth theHeight REPLACE 0 0)
(gimp-edit-cut theImage theLayer)
(gimp-selection-none theImage)
(gimp-layer-set-offsets theLayer theWidth theHeight)
(cjg-pasteat 1 1) (cjg-pasteat 1 2) (cjg-pasteat 1 3)
(cjg-pasteat 2 1) (cjg-pasteat 2 2) (cjg-pasteat 2 3)
(cjg-pasteat 3 1) (cjg-pasteat 3 2) (cjg-pasteat 3 3)
(gimp-selection-none theImage)
(if (= inType FALSE)
(plug-in-gauss-iir TRUE theImage theLayer inRadius inHoriz inVert)
(plug-in-gauss-rle TRUE theImage theLayer inRadius inHoriz inVert)
)
(gimp-layer-resize theLayer theWidth theHeight (- 0 theWidth) (- 0 theHeight))
(gimp-layer-set-offsets theLayer 0 0)
(gimp-image-enable-undo theImage)
(gimp-displays-flush)
)
(define (cjg-pasteat xoff yoff)
(let ((theFloat (car(gimp-edit-paste theImage theLayer 0))))
(gimp-layer-set-offsets theFloat (* xoff theWidth) (* yoff theHeight) )
(gimp-floating-sel-anchor theFloat)
)
)
; Register the function with the GIMP:
(script-fu-register
"script-fu-tile-blur"
"<Image>/Filters/Blur/Tilable Blur"
"foo"
"Chris Gutteridge"
"1998, Chris Gutteridge / ECS dept, University of Southampton, England."
"25th April 1998"
"RGBA RGB"
SF-IMAGE "The Image" 0
SF-DRAWABLE "The Layer" 0
SF-VALUE "Radius:" "5"
SF-TOGGLE "Blur Vertically?" TRUE
SF-TOGGLE "Blur Horizontally?" TRUE
SF-TOGGLE "Blur Type: TRUE=RLE, FALSE=IIR" FALSE
)