[Gimp-developer] Doing an action for each color in an indexed color-palette

David Gowers 00ai99 at gmail.com
Wed Jun 27 03:35:17 PDT 2007


On 6/27/07, Roberto Uhlig <Roberto.Uhlig at web.de> wrote:
> Hello,
> has/knows anyone a script/plugin (an idea) to go color by color through an indexed color-palette and doing an action for each color?
> I d like to create from a picture with an optimized color-palette with ca. 5-10 (may be 1-256) colors new layers or new pictures for each color in palette.
> Layer(s) or pictures must have the same extensions like the original picture.
> The new picture must be a black and white (1-bit) palette binary tiff for using in geo information systems as visible and invisible.
I do have an idea:

1. set the image's colormap to a grayscale gradient, where the
intensity matches the index (eg. at index 0, #000000, at index 9,
#090909..)
2. copy that

for each indice in the palette:
3. paste it as a new greyscale image
4. use the threshold function with (indice, indice) as it's range parameters
5. indexize to monochrome
6. save that image
7. delete the image from memory.
loop...

That can be completely automated by scripting


More information about the Gimp-developer mailing list