Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;LAYER-MODE-LCH-LIGHTNESS (27)
- ;LAYER-MODE-DARKEN-ONLY-LEGACY (9)
- ;you can use also 27 instead of 10
- ;
- (define (script-FU-Mazzetta img drawable radius amount threshold)
- ;duplico il layer
- (gimp-image-undo-group-start img)
- (let* (
- (MaskImage (car (gimp-image-duplicate img)))
- (MaskLayer (cadr (gimp-image-get-layers MaskImage)))
- (value-layer1 (car (gimp-layer-copy drawable 0)))
- (value-layer2 (car (gimp-layer-copy drawable 0)))
- )
- (gimp-item-set-name value-layer1 "Blend10")
- (gimp-item-set-name value-layer2 "Blend09")
- (gimp-image-insert-layer img value-layer1 0 -1)
- (gimp-image-insert-layer img value-layer2 0 -1)
- (gimp-image-set-active-layer img (car (gimp-image-get-layer-by-name img "Blend10")))
- (gimp-layer-set-mode value-layer1 27)
- (plug-in-unsharp-mask 1 img value-layer1 radius amount threshold)
- (gimp-image-set-active-layer img (car (gimp-image-get-layer-by-name img "Blend09")))
- (gimp-layer-set-mode value-layer2 9)
- (gimp-layer-set-opacity value-layer2 50)
- (let* (
- (new-layer (car (gimp-image-merge-down img (car (gimp-image-get-layer-by-name img "Blend09")) 1 )))
- )
- (gimp-image-set-active-layer img (car (gimp-image-get-layer-by-name img "Blend10")))
- (gimp-item-set-name new-layer "Blend10")
- (gimp-layer-set-mode new-layer 27)
- ;(gimp-convert-grayscale MaskImage)
- (let* (
- (mask (car (gimp-layer-create-mask (car (gimp-image-get-layer-by-name img "Blend10")) ADD-BLACK-MASK )))
- )
- (gimp-layer-add-mask new-layer mask)
- (gimp-selection-all MaskImage)
- ;new mod
- (plug-in-vinvert TRUE MaskImage (aref MaskLayer 0))
- (gimp-edit-copy (aref MaskLayer 0))
- (gimp-floating-sel-anchor (car (gimp-edit-paste mask FALSE)))
- (gimp-image-delete MaskImage)
- ;(gimp-drawable-invert mask FALSE)
- )))
- (gimp-image-undo-group-end img)
- (gimp-displays-flush)
- )
- (script-fu-register
- "script-FU-Mazzetta"
- _"Mazzetta v2"
- _""
- "Andrea Verdi"
- "Andrea Verdi"
- "2018"
- "RGB*"
- SF-IMAGE "Image" 0
- SF-DRAWABLE "Drawable" 0
- SF-ADJUSTMENT _"Radius min" '(0.3 0.1 120.0 0.1 1.0 1 0)
- SF-ADJUSTMENT _"Amount min" '(0.4 0.1 10.0 0.01 1.0 2 0)
- SF-ADJUSTMENT _"Threshold min" '(0 0 255 1 5 0 0)
- )
- (script-fu-menu-register "script-FU-Mazzetta"
- "<Image>/Filters/Image/")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement