Hey guys!
Im not very good at coding and I know little about scm. Any help would be really appreciated...
Trying to find the dominate color in a image and return it to "foreground box".
I got the RGB values but not sure how to link it up to the box.
(define (Sticker-1 image layer)
(let* (
(histo_RED (gimp-histogram layer HISTOGRAM-RED 0 255))
(R_value (number->string (car (cdr (cdr histo_RED)))))
(histo_GREEN (gimp-histogram layer HISTOGRAM-GREEN 0 255))
(G_value (number->string (car (cdr (cdr histo_GREEN)))))
(histo_BLUE (gimp-histogram layer HISTOGRAM-BLUE 0 255))
(B_value (number->string (car (cdr (cdr histo_BLUE )))))
)
; (gimp-message-set-handler ERROR-CONSOLE)
; (gimp-message (string-append R_value " " G_value " " B_value))
; (gimp-displays-flush)
(gimp-context-set-foreground (list R_value G_value B_value))
(gimp-edit-fill layer FOREGROUND-FILL)
(gimp-displays-flush)
)
)
(script-fu-register "Sticker-1"
_"Sticker _1..."
"Add outlines to image via avg COLOR."
"CB"
"NN"
"April 2017"
""
SF-IMAGE "Input Image" 0
SF-DRAWABLE "Input Drawable" 0
)
(script-fu-menu-register "Sticker-1" "<Image>/Filters/Edge-Detect")