Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define (FU-remove-ca img drawable blur-radius)
- (gimp-image-undo-group-start img)
- (gimp-selection-none img)
- ; Create a new layer
- (define value-layer (car (gimp-layer-copy drawable 0)))
- ; Give it a name
- (gimp-item-set-name value-layer "CA-PF")
- ; Add the new layer to the image
- (gimp-image-insert-layer img value-layer 0 0)
- (gimp-image-set-active-layer img (car (gimp-image-get-layer-by-name img "CA-PF")))
- (gimp-layer-set-mode (car (gimp-image-get-layer-by-name img "CA-PF")) COLOR-MODE )
- ; Call a plugin to blur the image
- (plug-in-gauss-rle2 1 img (car (gimp-image-get-layer-by-name img "CA-PF")) blur-radius blur-radius)
- (let ((layer-mask (car (gimp-layer-create-mask drawable ADD-BLACK-MASK))))
- (gimp-image-add-layer-mask img (car (gimp-image-get-layer-by-name img "CA-PF")) layer-mask)
- (gimp-edit-copy (car (gimp-image-get-layer-by-name img "CA-PF"))))
- (gimp-image-undo-group-end img)
- (gimp-displays-flush)
- )
- (script-fu-register "FU-remove-ca"
- "<Image>/Filters/Image/Remove-CA"
- "FU-remove-ca"
- "Andrea Verdi"
- "Andrea Verdi"
- "2018"
- "*"
- SF-IMAGE "Image" 0
- SF-DRAWABLE "Drawable" 0
- SF-ADJUSTMENT _"Blur amount" '(3 1 100 1 10 1 0)
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement