Advertisement
metallaro1980

remove-ca with gaussian-blur plugin and a black-level mask

Apr 4th, 2018
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. (define (FU-remove-ca img drawable blur-radius)
  2. (gimp-image-undo-group-start img)
  3. (gimp-selection-none img)
  4. ; Create a new layer
  5. (define value-layer (car (gimp-layer-copy drawable 0)))
  6.  
  7. ; Give it a name
  8. (gimp-item-set-name value-layer "CA-PF")
  9.  
  10. ; Add the new layer to the image
  11. (gimp-image-insert-layer img value-layer 0 0)
  12.  
  13. (gimp-image-set-active-layer img (car (gimp-image-get-layer-by-name img "CA-PF")))
  14.  
  15. (gimp-layer-set-mode (car (gimp-image-get-layer-by-name img "CA-PF")) COLOR-MODE )
  16.  
  17. ; Call a plugin to blur the image
  18. (plug-in-gauss-rle2 1 img (car (gimp-image-get-layer-by-name img "CA-PF")) blur-radius blur-radius)
  19.  
  20.  
  21.  
  22. (let ((layer-mask (car (gimp-layer-create-mask drawable ADD-BLACK-MASK))))
  23. (gimp-image-add-layer-mask img (car (gimp-image-get-layer-by-name img "CA-PF")) layer-mask)
  24. (gimp-edit-copy (car (gimp-image-get-layer-by-name img "CA-PF"))))
  25. (gimp-image-undo-group-end img)
  26. (gimp-displays-flush)
  27.  
  28. )
  29.  
  30. (script-fu-register "FU-remove-ca"
  31. "<Image>/Filters/Image/Remove-CA"
  32. "FU-remove-ca"
  33. "Andrea Verdi"
  34. "Andrea Verdi"
  35. "2018"
  36. "*"
  37. SF-IMAGE "Image" 0
  38. SF-DRAWABLE "Drawable" 0
  39. SF-ADJUSTMENT _"Blur amount" '(3 1 100 1 10 1 0)
  40. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement