I want to convert an image to indexed colors using something like 3 to 10 colors.
I got that step.
Now i am onto getting these indexed colors so that i can select by color tool each one of the colors one by one to perform a function (hatching script i created).
which functions should i be looking at?
At some point before calling my function (hatching script) I have to convert back into RGB to use other color values, i'll have to manually calculate the RGB values.
Any help is appreciated.
Thanks in advance.
I tried
(set! palette-name (gimp-context-get-palette))
(set! num-of-colors (car (gimp-palette-get-colors palette-name)))
(set! color-array (caadr (gimp-palette-get-colors palette-name)))
but it's giving me error on gimp-palette-get-colors about "Error: ( : 1) Invalid type for argument 1 to gimp-palette-get-colors"
also what's weird if i run the script again it's complaining that the image is already in indexed mode
but the image doesn't seem to be converted ..but if i switch to indexed mode manually nothing happens and if i manually convert back to RGB then it shows it indexed colors (5 colors in this example) its' as if my errors on getting the palette has left gimp confused between these modes.