GIMP Script-fu

Artifact Content

Artifact b5d7e55c90569477999cf8fb1f851b5f9c6d6047:

Wiki page [sg-indexed-decompose] by saulgoode 2013-08-28 23:32:24.
D 2013-08-28T23:32:24.341
L sg-indexed-decompose
P 74cce88043c4bad6b4edbfb6a0e877fda6eec3d7
U saulgoode
W 1601
<dt><b>Command:</b> <dd>Indexed Decompose</dd></dt>
<dt><b>Menu:</b> <dd>"<Image>/Filters/Colors/Indexed Decompose"</dd></dt>
<dt><b>PDB Name:</b> <dd>script-fu-sg-indexed-decompose</dd></dt>
<dt><b>Download:</b> <dd>[|sg-indexed-decompose.scm] (after the page appears, click on the "Download" command)</dd></dt>
<dt><b>License:</b> <dd>[copyright|GPLv2+]</dd></dt>

<dt><b>Description:</b> <dd>This script will split a layer into separate layers based upon its original colors. The original layer is not affected, instead a new layer group containing the generated layers will be created. 

If the original image is in Indexed Mode then the number of layers created will be equal to the number of colors in the original layer's palette(/colormap). If the original is in RGB or Grayscale Mode then the number of layers created will be the number of unique colors in the original, up to a maximum of 256 colors. It is typically advisable my [sg-quantize|Quantize script] be used to reduce the number of colors in an RGB image before running this script.

Note: this script requires GIMP 2.8 or later.

The following graphic shows the layerstack of the result of running the script on an 8-color rendering of the image on the right (image courtesy of user Nachbarnebenan of the [|Meet The GIMP forums]):

<center><img src="" />

Z 8a711e739185ac22227c2da603f940f8