GIMP Script-fu

Artifact Content
Login

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
<dl>
<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>[http://chiselapp.com/user/saulgoode/repository/script-fu/artifact/1833f8002f66b67d5a6aa489fd9ccbb9dc69ca62|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 [http://forum.meetthegimp.org/index.php|Meet The GIMP forums]):

<center><img src="http://barn.kerosenecow.net/mgoblin_media/media_entries/37/SS-indexed-decomp.png" />
</center>
</dd></dt>
</dl>

Z 8a711e739185ac22227c2da603f940f8