Split to Layers

This script will separate each contiguous group of pixels to its own layer. In the example below, the layer “Image” was split into 3 separate layers.