Skip to content

Instantly share code, notes, and snippets.

@smailliwcs
Last active September 22, 2020 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smailliwcs/1ee8ee081732a7b3f11e0c1666db50c7 to your computer and use it in GitHub Desktop.
Save smailliwcs/1ee8ee081732a7b3f11e0c1666db50c7 to your computer and use it in GitHub Desktop.
GIMP script: script-fu-highlight
(define (script-fu-highlight image
drawable
padding
shadow)
(if (= (car (gimp-selection-is-empty image)) TRUE)
(gimp-message "Select an area to highlight.")
(let ((selection 0))
(gimp-undo-push-group-start image)
(set! selection (car (gimp-selection-save image)))
(gimp-selection-grow image (/ padding 2))
(gimp-selection-feather image padding)
(gimp-selection-invert image)
(gimp-levels drawable HISTOGRAM-VALUE 0 255 1 0 shadow)
(gimp-image-select-item image CHANNEL-OP-REPLACE selection)
(gimp-image-remove-channel image selection)
(gimp-undo-push-group-end image)
(gimp-displays-flush))))
(script-fu-register "script-fu-highlight"
"_Highlight..."
"Highlight the current selection"
"Steven Williams"
"Steven Williams"
"2014"
"RGB* GRAY*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Layer" 0
SF-ADJUSTMENT "Padding" '(10 0 100 1 10 0 SF-SPINNER)
SF-ADJUSTMENT "Shadow" '(127 0 255 1 10 0 SF-SLIDER))
(script-fu-menu-register "script-fu-highlight" "<Image>/Filters/Light and Shadow/Light")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment