PDA

Vollständige Version anzeigen : Copypaper-Kunst, Tricks zu Bildverbesserung.


flashnfantasy
14.10.2004, 14:54
Jetzt wird es bunt !
Den zweiten grossen Script in dieser Woche werde ich nicht mehr beschreiben. Dafür sind alle wichtigen Parameter als Schrift im Bild drinnen, und ich demonstriere weitgehend an Beispielen, was mit dem Script möglich ist.

Motivation:
Beim Photoshop gibt es einen Filter mit dem Namen Copy-Paper, und diesem Filter habe ich sehr nachgetrauert beim Umstieg auf GIMP.
Mit diesem Filter konnte man nämlich schwierige Bilder auch noch auf den miesesten Druckern wiedergeben. Eigentlich erzeugte der Filter ein 'kantenorientiertes Bild'.
Klar, daß ich was ähnliches hier mit Scripten versucht habe. Mit der Zeit habe ich entdeckt, wie man die subjektive Darstellungsqualität von allen Bildern anhebt.

Hier mal das erste Beispiel:
1. Oben Links das Original-SW.
2. Oben Rechts ist das Gegenstück zum Copypaper-Filter von Adobe.
3+4. Zwei weitere auf Copypaper basierende Einstellungen
http://gimpforum.de/album_pic.php?pic_id=250

Und jetzt kommt der eigentliche Vorteil gegenüber dem Adobe, das ganze geht auch in Farbe:
http://gimpforum.de/album_pic.php?pic_id=251

flashnfantasy
14.10.2004, 14:57
Und hier der Script:


(script-fu-register "script-fu-copypaper-a"
_"<Image>/Script-Fu/SW-Photo/Copypaper Art"
"Aehnlich dem Filter Copypaper im Adobe-Photoshop"
"Mathias Weitz"
"Mathias Weitz"
"18/07/03"
""
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-ADJUSTMENT _"Gradation" '(1 0.5 5 0.25 0.25 2 0)
SF-OPTION _"Copy-Style" '(_"Gauss"
_"Gauss add"
_"Neg"
_"Grain neg"
_"Neg 4"
_"Neg 16"
_"Rand 4"
_"Rand 16"
_"Gauss 90-50-5"
_"Gauss 75-50-5"
_"Gauss 90-100-10"
_"Gauss 75-100-20"
_"Sobel"
_"Sobel 128"
_"Edge 1"
_"Edge 2"
_"Edge 3")
SF-ADJUSTMENT _"Details" '(200 1 1500 100 100 0 0)
SF-ADJUSTMENT _"Edge" '(0 -10 10 1 1 0 0)
SF-OPTION _"Layers" '(_"1"
_"1+2"
_"1+3"
_"1+4"
_"1+8"
_"1*2"
_"1*4"
_"1*8"
_"1+2+4"
_"1+3+6"
_"1+6"
_"1+10"
_"+2 mul"
_"+5 mul"
_"+2 ovl"
_"+5 ovl"
_"1+50"
_"1+100"
_"1*10"
_"1*50"
_"1+4 * (+5)"
_"1+(4 Grad+1)"
_"1+(10 Grad+1)")
SF-OPTION _"Blur" '(_"Gauss"
_"Spread (safe)"
_"Spread (interaktiv)")
SF-OPTION _"Invert" '(_"None"
_"Copy-Layer"
_"Plakat-Layer"
_"Both")
SF-ADJUSTMENT _"Overlay" '(0 0 100 10 10 0 0)
SF-ADJUSTMENT _"Sharpen-radius" '(2 1 20 1 1 1 0)
SF-ADJUSTMENT _"Sharpen-amount" '(0 0 5 0.1 0.1 1 0)
SF-OPTION _"Background" '(_"none"
_"multiply"
_"value"
_"darken"
_"overlay"
_"hard"
_"soft"
_"grain extract"
_"grain merge"
_"screen")
SF-OPTION _"BackgroundColor" '(_"Normal"
_"Desaturate but Background"
_"Desaturate all"
_"Desaturate but Background+100%"
_"Background+100%"
_"Background Auto-HSV")
SF-OPTION _"Original-Color" '(_"None"
_"Original"
_"Original Gauss-25"
_"Copy Gauss-25")
SF-ADJUSTMENT _"Background\nSoft" '(0 0 200 5 5 0 0)
SF-ADJUSTMENT _"Source" '(255 0 255 16 16 0 0)
SF-ADJUSTMENT _"Target" '(0 0 224 16 16 0 0)
SF-ADJUSTMENT _"Gradation" '(1 0.5 5 0.25 0.25 2 0)
SF-OPTION _"description" '(_"None"
_"small upper left"
_"small lower right"
_"big upper left"
_"big lower right"
_"Descr at layer")
)

(define (copy-paper inImage inLayer grad copystyle soft dark blur softlayer invert noise plakatsoft)
(set! layerA (car (gimp-layer-new inImage (car (gimp-image-width inImage)) (car (gimp-image-height inImage)) 1 "Copypaper" 100 0)))
(gimp-image-add-layer inImage layerA 0)
(gimp-edit-copy inLayer)
(set! flayerA (car (gimp-edit-paste layerA 0)))
(gimp-floating-sel-anchor flayerA)
(gimp-selection-clear inImage)
(gimp-levels layerA 0 0 255 grad 0 255)
(if (or (= invert 1) (= invert 3)) (gimp-invert layerA))
;
(set! layerB (car (gimp-layer-new inImage (car (gimp-image-width inImage)) (car (gimp-image-height inImage)) 1 "Addition" 100 15)))
(gimp-image-add-layer inImage layerB 0)
(gimp-edit-copy inLayer)
(set! flayerB (car (gimp-edit-paste layerB 0)))
(gimp-floating-sel-anchor flayerB)
(gimp-selection-clear inImage)
(gimp-levels layerB 0 0 255 grad 0 255)
(if (or (= invert 1) (= invert 3)) (gimp-invert layerB))

(if (= copystyle 0)
(begin
(gimp-layer-set-mode layerB 15)))
(if (= copystyle 1)
(begin
(gimp-layer-set-mode layerB 7)
(gimp-invert layerB)))

(if (and (< 1 copystyle) (< copystyle 12))
(begin
(set! layerC (car (gimp-layer-new inImage (car (gimp-image-width inImage)) (car (gimp-image-height inImage)) 1 "Addition" 100 15)))
(gimp-image-add-layer inImage layerC 0)
(gimp-edit-copy inLayer)
(set! flayerC (car (gimp-edit-paste layerC 0)))
(gimp-floating-sel-anchor flayerC)
(gimp-selection-clear inImage)
(gimp-layer-set-mode layerC 6)
(gimp-levels layerC 0 0 255 grad 0 255)
(if (or (= invert 1) (= invert 3)) (gimp-invert layerC))
))

(if (< 0 soft)
(begin
(if (< 11 copystyle) (set! soft (/ soft 10)))
(if (= 0 blur)
(plug-in-gauss-iir2 1 inImage layerB soft soft))
(if (= 1 blur)
(begin
(set! msoft soft)
(while (< 0 msoft)
(if (<= msoft 200) (begin (plug-in-spread 1 inImage layerB msoft msoft) (set! msoft 0)))
(if (< 200 msoft) (begin (plug-in-spread 1 inImage layerB 200 200) (set! msoft (- msoft 200))))
)))
(if (= 2 blur)
(begin
(if (<= soft 200)
(plug-in-spread 1 inImage layerB soft soft))
(if (< 200 soft)
; Interaktive Abfrage
(plug-in-spread 0 inImage layerB 200 200))
))
))


(if (and (< 1 copystyle) (< copystyle 12))
(begin
(set! layerB (car (gimp-image-merge-down inImage layerC 0)))
(gimp-invert layerB)
(if (= copystyle 2) (gimp-layer-set-mode layerB 5))
(if (= copystyle 3) (gimp-layer-set-mode layerB 21))
(if (= copystyle 4) (gimp-layer-set-mode layerB 0))
(if (= copystyle 5) (gimp-layer-set-mode layerB 0))
(if (= copystyle 6) (gimp-layer-set-mode layerB 6))
(if (= copystyle 7) (gimp-layer-set-mode layerB 6))
))

; Sobel
(if (and (< 11 copystyle) (< copystyle 14))
(begin
(gimp-image-raise-layer inImage layerA)
(gimp-layer-set-mode layerA 13)
(gimp-layer-set-mode layerB 0)
(plug-in-edge 1 inImage layerB 10 1 0)
(gimp-invert layerB)
(if (= copystyle 12) (gimp-levels layerB 0 0 (+ 192 (* 6 dark)) 1 0 255))
(if (= copystyle 13) (gimp-levels layerB 0 128 (+ 224 (* 3 dark)) 2 0 255))
(set! layerB layerA)
))

; Edge
(if (and (< 13 copystyle) (< copystyle 17))
(begin
(gimp-image-raise-layer inImage layerA)
(gimp-layer-set-mode layerA 13)
(gimp-layer-set-mode layerB 0)
(if (= 14 copystyle) (plug-in-edge 1 inImage layerB 10 2 4))
(if (= 15 copystyle) (plug-in-edge 1 inImage layerB 10 2 4))
(if (= 16 copystyle) (plug-in-edge 1 inImage layerB 10 2 3))
(gimp-invert layerB)
(gimp-levels-auto layerB)
(gimp-levels layerB 0 0 255 (+ 0.55 (/ dark 25)) 0 255)
(set! layerB layerA)
))

; Gradient
(if (or (not (= dark 0)) (< 3 copystyle))
(begin
(set! adark (+ dark 1))
(set! bdark (+ (* dark 5) 189))
(if (< dark 0) (set! adark (+ (/ dark 10) 1)))
(if (= adark 0) (set! adark 0.1))
(if (< 10 adark) (set! adark 10))

(if (= copystyle 0)
(gimp-levels layerA 0 0 255 (+ (/ dark 20) 1) 0 255))
(if (= copystyle 1)
(gimp-levels layerB 0 0 255 (+ (/ dark 20) 1) 0 255))
(if (= copystyle 2)
(gimp-levels layerB 0 0 255 adark 0 255))
(if (= copystyle 3)
(gimp-levels layerB 0 0 255 adark 0 255))
(if (= copystyle 4)
(gimp-levels layerB 0 bdark (+ bdark 4) 1 0 255))
(if (= copystyle 5)
(gimp-levels layerB 0 bdark (+ bdark 16) 1 0 255))
(if (= copystyle 6)
(begin
(gimp-levels layerB 0 bdark (+ bdark 4) 1 0 255)
(gimp-invert layerB)
))
(if (= copystyle 7)
(begin
(gimp-levels layerB 0 bdark (+ bdark 16) 1 0 255)
(gimp-invert layerB)
))
))

(set! layerResult (car (gimp-image-merge-down inImage layerB 0)))
;(set! layerResult layerB)

(if (< 0 softlayer)
(begin
(set! layerSoft (car (gimp-layer-new inImage (car (gimp-image-width inImage)) (car (gimp-image-height inImage)) 1 "SoftCopy" 100 OVERLAY)))
(gimp-image-add-layer inImage layerSoft 0)
(gimp-edit-copy layerResult)
(set! flayerSoft (car (gimp-edit-paste layerSoft 0)))
(gimp-floating-sel-anchor flayerSoft)
(if (< 0 plakatsoft)
(plug-in-gauss-iir2 1 inImage layerSoft softlayer softlayer))
(set! layerResult (car (gimp-image-merge-down inImage layerSoft 0)))
))
layerResult
)

;;; Dedicated to Miro
(define (script-fu-copypaper-a inImage inLayer grad copystyle soft dark nLayers blur invert softlayer sharpen-radius sharpen-amount plakat desaturate noise plakatsoft plakatsource plakatstart plakatgrad Descr)
(gimp-image-undo-disable inImage)
;(gimp-undo-push-group-start inImage)
(set! finalName "Copypaper Art:")
(set! plakatName "")

(set! theWidth (car (gimp-image-width inImage)))
(set! theHeight (car (gimp-image-height inImage)))
(gimp-selection-all inImage)
;

(set! workLayer inLayer)
(set! workcopystyle copystyle)
(if (and (< 7 copystyle) (< copystyle 12))
(begin
(set! workcopystyle 0)

(set! layerSCO (car (gimp-layer-new inImage (car (gimp-image-width inImage)) (car (gimp-image-height inImage)) 1 "NBasic" 100 3)))
(gimp-image-add-layer inImage layerSCO 0)
(gimp-edit-copy inLayer)
(set! flayerSCO (car (gimp-edit-paste layerSCO 0)))
(gimp-floating-sel-anchor flayerSCO)
(gimp-layer-set-mode layerSCO 0)

(set! layerSCA (car (gimp-layer-new inImage (car (gimp-image-width inImage)) (car (gimp-image-height inImage)) 1 "NBasicSoft" 100 3)))
(gimp-image-add-layer inImage layerSCA 0)
(gimp-edit-copy inLayer)
(set! flayerSCA (car (gimp-edit-paste layerSCA 0)))
(gimp-floating-sel-anchor flayerSCA)
(gimp-layer-set-mode layerSCA 0)

(if (= 8 copystyle)
(begin
(gimp-layer-set-opacity layerSCA 90)
(plug-in-gauss-iir2 1 inImage layerSCA 50 50)
))
(if (= 9 copystyle)
(begin
(gimp-layer-set-opacity layerSCA 75)
(plug-in-gauss-iir2 1 inImage layerSCA 50 50)
))
(if (= 10 copystyle)
(begin
(gimp-layer-set-opacity layerSCA 90)
(plug-in-gauss-iir2 1 inImage layerSCA 100 100)
))
(if (= 11 copystyle)
(begin
(gimp-layer-set-opacity layerSCA 75)
(plug-in-gauss-iir2 1 inImage layerSCA 100 100)
))
(set! workLayer (car (gimp-image-merge-down inImage layerSCA 0)))
))
;

(if (< 0 plakat)
(begin
(set! plakatName (string-append plakatName "\n (Soft: "))
(set! plakatName (string-append plakatName (number->string plakatsoft)))
(set! plakatName (string-append plakatName " Source:"))
(set! plakatName (string-append plakatName (number->string plakatsource)))
(set! plakatName (string-append plakatName " Target:"))
(set! plakatName (string-append plakatName (number->string plakatstart)))
(set! plakatName (string-append plakatName " Grad:"))
(set! plakatName (string-append plakatName (number->string plakatgrad)))
(set! plakatName (string-append plakatName ")"))
(set! layerC (car (gimp-layer-new inImage (car (gimp-image-width inImage)) (car (gimp-image-height inImage)) 1 "Plakat" 100 3)))
(gimp-image-add-layer inImage layerC 0)
(gimp-edit-copy inLayer)
(set! flayerC (car (gimp-edit-paste layerC 0)))
(gimp-floating-sel-anchor flayerC)
(gimp-layer-set-mode layerC 0)
(if (or (= invert 2) (= invert 3)) (gimp-invert layerC))
(if (or (not (= plakatgrad 1.0)) (< plakatsource 255))
(gimp-levels layerC 0 0 plakatsource plakatgrad 0 255))
(if (not (= plakatsoft 0.0))
(plug-in-gauss-iir2 1 inImage layerC plakatsoft plakatsoft))
;(plug-in-c-astretch 0 inImage layerC)
(if (not (= plakatstart 1))
(gimp-levels layerC 0 0 255 1 plakatstart 255))
;(if (not (= cubsize 0.0))
; (plug-in-cubism 1 inImage layerC cubsize cubsat 1))
(if (= desaturate 3) (begin (set! desaturate 1) (gimp-hue-saturation layerC 0 0 0 100)))
(if (= desaturate 4) (begin (set! desaturate 0) (gimp-hue-saturation layerC 0 0 0 100)))
(if (= desaturate 5) (begin (set! desaturate 0) (plug-in-autostretch-hsv 1 inImage layerC)))
))


;
(set! finalName (string-append finalName "\nGradation: "))
(set! finalName (string-append finalName (number->string grad)))
(set! finalName (string-append finalName "\nCopy-Style: "))
(if (= 0 copystyle) (set! finalName (string-append finalName "Gauss")))
(if (= 1 copystyle) (set! finalName (string-append finalName "Gauss add")))
(if (= 2 copystyle) (set! finalName (string-append finalName "Neg")))
(if (= 3 copystyle) (set! finalName (string-append finalName "Grain neg")))
(if (= 4 copystyle) (set! finalName (string-append finalName "Neg 4")))
(if (= 5 copystyle) (set! finalName (string-append finalName "Neg 16")))
(if (= 6 copystyle) (set! finalName (string-append finalName "Rand 4")))
(if (= 7 copystyle) (set! finalName (string-append finalName "Rand 16")))
(if (= 8 copystyle) (set! finalName (string-append finalName "Gauss 90-50-5")))
(if (= 9 copystyle) (set! finalName (string-append finalName "Gauss 75-50-5")))
(if (= 10 copystyle) (set! finalName (string-append finalName "Gauss 90-100-10")))
(if (= 11 copystyle) (set! finalName (string-append finalName "Gauss 75-100-20")))
(if (= 12 copystyle) (set! finalName (string-append finalName "Sobel")))
(if (= 13 copystyle) (set! finalName (string-append finalName "Sobel 128")))
(if (= 14 copystyle) (set! finalName (string-append finalName "Edge 1")))
(if (= 15 copystyle) (set! finalName (string-append finalName "Edge 2")))
(if (= 16 copystyle) (set! finalName (string-append finalName "Edge 3")))
(set! finalName (string-append finalName "\nDetails: "))
(set! finalName (string-append finalName (number->string soft)))
(set! finalName (string-append finalName "\nEdge: "))
(set! finalName (string-append finalName (number->string dark)))

(set! layerResult (copy-paper inImage workLayer grad workcopystyle soft dark blur softlayer invert noise plakatsoft))

(set! finalName (string-append finalName "\nLayers:"))
(if (= nLayers 0) (set! finalName (string-append finalName " 1")))
(if (= nLayers 1)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 2) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 9)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1+2"))
))
(if (= nLayers 2)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 3) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 9)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1+3"))
))
(if (= nLayers 3)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 4) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 9)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1+4"))
))
(if (= nLayers 4)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 8) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 9)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1+8"))
))
(if (= nLayers 5)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 2) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 3)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1*2"))
))
(if (= nLayers 6)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 4) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 3)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1*4"))
))
(if (= nLayers 7)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 8) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 3)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1*8"))
))
(if (= nLayers 8)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 2) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 9)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 4) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 9)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1+2+4"))
))
(if (= nLayers 9)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 3) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 9)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 6) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 9)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1+3+6"))
))
(if (= nLayers 10)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 6) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 9)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1+6"))
))
(if (= nLayers 11)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 10) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 9)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1+10"))
))

; +2 mul
(if (= nLayers 12)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle soft (+ dark 2) blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 3)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " +2 mul"))
))
; +5 mul
(if (= nLayers 13)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle soft (+ dark 5) blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 3)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " +5 mul"))
))

; +2 ovl
(if (= nLayers 14)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle soft (+ dark 2) blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA OVERLAY)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " +2 mul"))
))
; +5 ovl
(if (= nLayers 15)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle soft (+ dark 5) blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA OVERLAY)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " +5 mul"))
))

(if (= nLayers 16)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 50) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 9)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1+50"))
))


(if (= nLayers 17)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 100) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 9)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1+100"))
))

(if (= nLayers 18)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 10) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 3)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1*10"))
))

(if (= nLayers 19)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 50) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 3)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1*50"))
))

(if (= nLayers 20)
(begin
(set! layerPA (copy-paper inImage workLayer grad workcopystyle (* soft 4) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 9)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! layerPA (copy-paper inImage workLayer grad workcopystyle soft (+ dark 5) blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 3)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1+4 * (+5)"))
))

(if (= nLayers 21)
(begin
(set! layerPA (copy-paper inImage workLayer (+ grad 1) workcopystyle (* soft 4) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 9)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1+(4 Grad+1)"))
))

(if (= nLayers 22)
(begin
(set! layerPA (copy-paper inImage workLayer (+ grad 1) workcopystyle (* soft 10) dark blur softlayer invert noise plakatsoft))
(gimp-layer-set-mode layerPA 9)
(set! layerResult (car (gimp-image-merge-down inImage layerPA 0)))
(set! finalName (string-append finalName " 1+(10 Grad+1)"))
))


(if (and (< 7 copystyle) (< copystyle 12))
(begin
(gimp-image-remove-layer inImage workLayer)
;(gimp-drawable-delete workLayer)
(if (= 8 copystyle) (plug-in-unsharp-mask 1 inImage layerResult 5 5 0))
(if (= 9 copystyle) (plug-in-unsharp-mask 1 inImage layerResult 5 5 0))
(if (= 10 copystyle) (plug-in-unsharp-mask 1 inImage layerResult 10 5 0))
(if (= 11 copystyle) (plug-in-unsharp-mask 1 inImage layerResult 20 5 0))
))

(set! finalName (string-append finalName "\nBlur: "))
(if (= 0 blur) (set! finalName (string-append finalName "Gauss")))
(if (= 1 blur) (set! finalName (string-append finalName "Spread (safe)")))
(if (= 2 blur) (set! finalName (string-append finalName "Spread (interaktiv)")))
(if (< 0 invert) (begin
(set! finalName (string-append finalName "\nInvert: "))
(if (= 1 invert) (set! finalName (string-append finalName "Copy-Layer")))
(if (= 2 invert) (set! finalName (string-append finalName "Plakat-Layer")))
(if (= 3 invert) (set! finalName (string-append finalName "Both-Layer")))
))
(if (< 0 softlayer) (begin
(set! finalName (string-append finalName "\nOverlay: "))
(set! finalName (string-append finalName (number->string softlayer)))
))

(if (< 0 sharpen-amount)
(begin
(plug-in-unsharp-mask 1 inImage layerResult sharpen-radius sharpen-amount 0)
(set! finalName (string-append finalName "\nSharpen: "))
(set! finalName (string-append finalName (number->string sharpen-radius)))
(set! finalName (string-append finalName " "))
(set! finalName (string-append finalName (number->string sharpen-amount)))
))


(if (= 3 noise)
(begin
(set! layerN (car (gimp-layer-new inImage (car (gimp-image-width inImage)) (car (gimp-image-height inImage)) 1 "Noise" 100 13)))
(gimp-image-add-layer inImage layerN 0)
(gimp-edit-copy layerResult)
(set! flayerN (car (gimp-edit-paste layerN 0)))
(gimp-floating-sel-anchor flayerN)
(plug-in-gauss-iir2 1 inImage layerN 25 25)
(set! layerResult (car (gimp-image-merge-down inImage layerN 0)))
))

(if (= desaturate 1)
(gimp-desaturate layerResult))
(plug-in-c-astretch 0 inImage layerResult)

(if (< 0 plakat)
(begin
(set! finalName (string-append finalName "\nPlakat: "))
(plug-in-c-astretch 0 inImage layerResult)
(if (= 1 plakat)
(begin
(set! finalName (string-append finalName "multiply"))
(gimp-layer-set-mode layerResult 3)))
(if (= 2 plakat)
(begin
(set! finalName (string-append finalName "value"))
(gimp-layer-set-mode layerResult 14)))
(if (= 3 plakat)
(begin
(set! finalName (string-append finalName "darken"))
(gimp-layer-set-mode layerResult 9)))
(if (= 4 plakat) ; overlay
(begin
(set! finalName (string-append finalName "overlay"))
(gimp-layer-set-mode layerResult 5)))
(if (= 5 plakat) ; hartes Licht
(begin
(set! finalName (string-append finalName "hard"))
(gimp-layer-set-mode layerResult 18)))
(if (= 6 plakat) ; weiches Licht
(begin
(set! finalName (string-append finalName "soft"))
(gimp-layer-set-mode layerResult 19)))
(if (= 7 plakat) ; grain merge
(begin
(set! finalName (string-append finalName "grain extract"))
(gimp-layer-set-mode layerResult 20)))
(if (= 8 plakat) ; grain merge
(begin
(set! finalName (string-append finalName "grain merge"))
(gimp-layer-set-mode layerResult 21)))
(if (= 9 plakat) ; screen
(begin
(set! finalName (string-append finalName "screen"))
(gimp-layer-set-mode layerResult 4)))
(if (= 10 plakat) ; color deprevicated due noise
(begin
(set! finalName (string-append finalName "color"))
(gimp-layer-set-mode layerC 13)
(gimp-image-raise-layer-to-top inImage layerC)
(set! layerResult layerC)))
(set! layerResult (car (gimp-image-merge-down inImage layerResult 0)))
(set! finalName (string-append finalName plakatName))
))

(if (= desaturate 2)
(gimp-desaturate layerResult))
(plug-in-c-astretch 0 inImage layerResult)

(set! finalName (string-append finalName "\nBackgroundColor: "))
(if (= desaturate 0) (set! finalName (string-append finalName "Normal")))
(if (= desaturate 1) (set! finalName (string-append finalName "Desaturate but Background")))
(if (= desaturate 2) (set! finalName (string-append finalName "Desaturate all")))
(if (= desaturate 3) (set! finalName (string-append finalName "Desaturate but Background+100%")))
(if (= desaturate 4) (set! finalName (string-append finalName "Background+100%")))
(if (= desaturate 5) (set! finalName (string-append finalName "Background Auto-HSV")))

(if (= 1 noise) (set! finalName (string-append finalName "\nOriginal-Color: Original")))
(if (= 2 noise) (set! finalName (string-append finalName "\nOriginal-Color: Original Gauss-25")))
(if (= 3 noise) (set! finalName (string-append finalName "\nOriginal-Color: Copy Gauss-25")))

(if (or (= 1 noise) (= 2 noise))
(begin
(set! layerN (car (gimp-layer-new inImage (car (gimp-image-width inImage)) (car (gimp-image-height inImage)) 1 "Noise" 100 13)))
(gimp-image-add-layer inImage layerN 0)
(gimp-edit-copy inLayer)
(set! flayerN (car (gimp-edit-paste layerN 0)))
(gimp-floating-sel-anchor flayerN)
(if (= 2 noise) (plug-in-gauss-iir2 1 inImage layerN 25 25))
(set! layerResult (car (gimp-image-merge-down inImage layerN 0)))
))

(if (< 0 Descr)
(begin
(set! dimendiv 30)
(if (or (= 1 Descr) (= 2 Descr)) (set! dimendiv 50))
(set! fontdim (gimp-text-get-extents-fontname finalName (/ (car (gimp-image-height inImage)) dimendiv) 0 "Courier New Bold"))
(set! fontdimx (car fontdim))
(set! fontdimy (cadr fontdim))
(set! descrx 0)
(set! descry 0)
(if (or (= 2 Descr) (= 4 Descr))
(begin
(set! descrx (- (car (gimp-image-width inImage)) fontdimx))
(set! descry (- (car (gimp-image-height inImage)) fontdimy))
(set! descrx (- descrx dimendiv))
))

(if (< Descr 5)
(begin
(gimp-palette-set-foreground '(0 0 0))
(set! tlayer (car (gimp-layer-new inImage (car (gimp-image-width inImage)) (car (gimp-image-height inImage)) 1 "tlayer" 100 0)))
(gimp-image-add-layer inImage tlayer 0)
(gimp-edit-fill tlayer 0)
(gimp-palette-set-foreground '(255 255 255))
(set! ddimendiv (/ (car (gimp-image-height inImage)) dimendiv))
(set! textlayer (car (gimp-text-fontname inImage -1 descrx descry finalName 0 TRUE ddimendiv 0 "Courier New Bold")))
(gimp-layer-set-mode textlayer 4)
(set! textlayer2 (car (gimp-layer-copy textlayer 1)))
(gimp-layer-set-mode textlayer2 6)
(gimp-image-add-layer inImage textlayer2 0)
(set! textlayer (car (gimp-image-merge-down inImage textlayer 0)))
(gimp-layer-set-mode textlayer 4)
(plug-in-gauss-iir2 1 inImage textlayer ddimendiv ddimendiv)
(plug-in-c-astretch 0 inImage textlayer)
(gimp-levels textlayer 0 0 64 1.0 0 255)
(set! layerResult (car (gimp-image-merge-down inImage textlayer 0)))
(set! layerResult (car (gimp-image-merge-down inImage textlayer2 0)))
))

(if (= 5 Descr) (gimp-layer-set-name layerResult finalName))
))

(gimp-image-set-active-layer inImage inLayer)
(gimp-image-undo-enable inImage)
(gimp-image-clean-all inImage)
(gimp-displays-flush))

flashnfantasy
20.10.2004, 00:09
http://gimpforum.de/album_pic.php?pic_id=263
http://gimpforum.de/album_pic.php?pic_id=264
http://gimpforum.de/album_pic.php?pic_id=265

flashnfantasy
20.10.2004, 01:50
http://gimpforum.de/album_pic.php?pic_id=266

http://gimpforum.de/album_pic.php?pic_id=267

http://gimpforum.de/album_pic.php?pic_id=268

http://gimpforum.de/album_pic.php?pic_id=269

http://gimpforum.de/album_pic.php?pic_id=270

peter-seth
06.11.2007, 22:32
ich habe das skript auf GIMP 2.4 umgestellt (let* eingebaut).
ausserdem habe ich den menü-pfad auf Filter->Artistic->Copypaper geändert.
und ein paar formatierungsänderungen gemacht, damit der code leichter lesbar ist.

ich konnte das skript fehlerfrei ausführen ... doch der effekt sieht nicht so toll aus wie bei dir hier:

264

äh, ich HÄTTE den code hier gern eingefügt, doch ist er mit über 30000 zeichen zu lang (das forum läßt nur 25000 zeichen zu ... ???)

also nur die neue Angabe für den Menü-Pfad und die let*-statements, kann man ggf selbst schnell einbauen ...

(script-fu-register "script-fu-copypaper-a"
_"<Image>/Filters/Artistic/Copypaper Art"

... ...


(define (copy-paper inImage inLayer grad copystyle soft dark blur softlayer invert noise plakatsoft)
(let*
(
(layerA (car (gimp-layer-new inImage (car (gimp-image-width inImage)) (car (gimp-image-height inImage)) 1 "Copypaper" 100 0)))
(flayerA ())
(layerB ())
(flayerB ())
(layerC ())
(flayerC ())
(msoft soft)
(adark 0)
(bdark 0)
(layerResult ())
(layerSoft ())
(flayerSoft ())
)

... ...

layerResult
) ; klammerzu zu let*
) ; end define copy-paper


(define (script-fu-copypaper-a inImage inLayer grad copystyle soft dark nLayers blur invert softlayer sharpen-radius sharpen-amount plakat desaturate noise plakatsoft plakatsource plakatstart plakatgrad Descr)

(let*
(
(finalName "Copypaper Art:")
(plakatName "")
(theWidth (car (gimp-image-width inImage)))
(theHeight (car (gimp-image-height inImage)))
(workLayer inLayer)
(workcopystyle copystyle)
(layerSCO ())
(flayerSCO ())
(layerSCA ())
(flayerSCA ())
(layerC ())
(flayerC ())
(layerResult ())
(layerPA ())
(layerN ())
(flayerN ())
(dimendiv ())
(fontdim ())
(fontdimx ())
(fontdimy ())
(descrx 0)
(descry 0)
(tlayer ())
(ddimendiv())
(textlayer ())
(textlayer2 ())
)

... ...

(gimp-displays-flush)
) ; klammerzu let*
) ; end define script-fu-copypaper-a