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.
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.
January 3, 2013 at 11:24 pm |
Simply brilliant. Big thanks. I can’t wait to when there are three times as many scripts!
April 23, 2013 at 8:37 am |
Nice, but it throws an error after the dialog -> “the object current document is not currently availabel”
Not useable on CS6
April 23, 2013 at 4:04 pm |
I created and tested it with Photoshop CS6, Standard and Extended, on both OSX and Windows. Can you give me any other info? Can you get it to work on something simple?
Sometimes there is some initial state I didn’t anticipate, like the layer is locked, a path is active, quick mask mode is on, color mode is set to indexed, etc. (It shouldn’t fail in any of those specific cases, though)
April 23, 2013 at 5:14 pm |
Well … actually there isn’t any more info. :(
I create a document, 500x500px, painting some strokes, then call the script. It starts, but soon, like after the first extraction, it stops with an error:
Error: General Photoshop error occurred. This functionality may not be available in this version of Photoshop. – The object “current document” is not currently available.
I tried on the locked background, I tried it on a transparent layer.
Photoshop CS6 (13.0) on Win7 64Bit
April 24, 2013 at 2:19 pm |
Have you updated to 13.0.1.1? I don’t know if that will help.
If that isn’t it, I really don’t know. There have been a few hundred downloads of the script, and this is the first I’ve heard of any issues.
April 24, 2013 at 5:52 pm |
I just tested it on a copy of PS CS6 with no updates and it worked fine. Sorry, I really don’t know why it isn’t working for you :-/
January 10, 2014 at 9:35 pm |
make sure to unlock the layer that you want to split buddies
it works!
:)
April 27, 2013 at 2:29 am |
I haven’t updated PS, as I’m one of those many out there, where the updates don’t work/install (I’m no Adobe Cloud Member).
Too bad, looks like I have to let this slip. :(
Thanks anyway for the reply.
May 2, 2013 at 3:54 am |
Update: With help from Adobe Support, I was able to update to 13.1.2. Now the script works as expected.
Great job.
May 18, 2013 at 5:36 am |
This script grabs only full visibility pixels (when tolerance = 0)…
How to remake it the script grabs no-full visibility pixels too (when tolerance = 0)?
Answer please.
May 22, 2013 at 4:40 pm |
I don’t know why it isn’t working. It should be treating all pixels the same, unless they are 100% transparent.
June 25, 2013 at 8:39 am |
This is fantastic. If I were able to append the filename with sequential letters of the alphabet, it would be perfect for my needs. Please stay in touch if you’re able to make these changes, I’ll happily come back and donate!!
January 10, 2014 at 9:34 pm |
make sure to unlock the layer that you want to split buddies
it works!
:)
January 15, 2014 at 5:55 am |
Works like a charm.
One thing I miss so.. I often use complex forms imported from illustrator. If I split these with the script, they lose there form tag and get rastered. Any chance to keep them as vectors?.
Right now I do it by hand. Select form with pressed Alt-Key, then new layer with Strg+Alt+J Keys..
ANyway thanks alot! :-)
January 26, 2014 at 6:09 pm |
Awesome, thanks! I wish this were available for Fireworks or Pixelmator, though.
July 12, 2014 at 9:57 am |
hi I got Error: General Photoshop error occurred. This functionality may not be available in this version of Photoshop. – The command “Expand” is not currently available.
what should I do?
September 6, 2014 at 1:05 am |
Were you able to resolve this? Can you tell me how you did?
September 6, 2014 at 5:19 pm |
Which version of Photoshop are you using?
August 15, 2023 at 9:37 am |
Hi David, I’m trying to download the “Scripts to layers” but I’m taken to a page that says “Not Found”. Could you please advise, as I would love to try out this script of yours.
August 15, 2023 at 12:19 pm |
I have updated the download link. Let me know if it works for you. I only have access to Photoshop CS6, so I can’t test the script on newer versions.
August 15, 2023 at 12:34 pm
Thanks for updating the download. I’ll let you know, but I may have the same problem as well with the newer version.
August 7, 2014 at 3:49 am |
Thank you SO SO SO much! Works like a charm!
November 15, 2014 at 11:19 am |
What a great script! Thank you so much. If anyone is wondering, yes, it works perfectly in Photoshop CC 2014 Win 8.1 (select File->Scripts->Browse)
January 7, 2015 at 5:48 pm |
thanks!!!!!!!!!!!!!!!!!!!!!!!!! :D :D :D
April 9, 2015 at 3:35 am |
A BIG BIG thank to the Author, you are AWESOME, working perfectly on PS cs6 win 64bits!!!!
May 24, 2015 at 11:23 am |
This tool works great! i was about to write one myself for imageMagick, but who has time for that!
When Getting this error:
The command “Expand” is not currently available.
Make sure that there are actual transparent pixels on the image. I found that if there are not any real transparent pixels, then this error comes up.
September 16, 2015 at 8:38 am |
Just too awesome! EXACTLY what I was looking for. The example is a bit misleading though. At first I thought maybe the contiguous group of pixels need to be of the same colour! But this script does way more hard work! Cheers n Thanks!
September 23, 2015 at 4:58 pm |
Hello my when I open script it asks how many pixels for continuous gap (may have the wrong) i leave 0 and all it seems to do is copy the photo with no layers
September 23, 2015 at 5:09 pm |
It will only create a new layer for each group of pixels that is surrounded by fully transparent pixels.
December 6, 2015 at 4:39 am |
THANK YOU!!!
January 4, 2016 at 8:46 pm |
Thank you. Very good work!!
It works flawlessly!!!!
It could be even better if it assumes the default values for gap and layer naming, after recording an action. As it is, you must press enter when asked for this values in the middle of an action.
Photoshop CC 2015.1.1 on Mac OSX 10.11.2
January 4, 2016 at 10:39 pm |
At the top of the script file you can set the default options.
Change “true” in this line to “false” to skip the dialog box.
var showOptionsDialog = true;
edit: oops, that line didn’t actually do anything, here is a fixed version https://www.dropbox.com/s/06lgq1glc05omwq/Split%20to%20Layers.zip?dl=0
April 5, 2016 at 1:38 pm |
Oh my god! Saved my life!!!
September 8, 2016 at 6:55 pm |
amazing thanks
December 7, 2016 at 9:26 am |
fantastic, works perfect. thank you greatly
December 28, 2016 at 4:45 am |
Thank you so much, this is very useful!
December 30, 2016 at 2:31 am |
So useful!! awesome script.
September 20, 2019 at 6:06 am |
Wooooow! u saved my day! Even for CC 2019 that miracle tool still working very well! Hugs from Brazil!
May 14, 2020 at 12:33 pm |
Just found this script and it is genius!! As a pattern designer who imports original artwork into photoshop, but then needs each motif on a different layer, this is going to save me HOURS of using the lasso tool and pasting into layers. Thank you so much!!!
September 24, 2020 at 7:54 am |
Works with CC 2020. Thank you so much.
November 18, 2020 at 12:43 am |
Woow this Script is Amazing!!! Thank you so much for sharing, I been cutting pieces by pieces on some pictures that have 200+ pieces, was really crazy I almost giving up and this script did it on on a few seconds, so lucky to find it.
It should be included on Photoshop by default
Keep up the good work, You are Awesome )))
August 3, 2021 at 2:01 pm |
Saved me about 2 hours of work. Thank you!
January 28, 2023 at 5:12 am |
22.5. Error: General Photoshop error occurred. This functionality may not be available in this version of Photoshop.
– The command “Layer Via Copy” is not currently available.
Layers with identical content gets duplicated, no objects are split individually.
Transparent file, unlocked.
28/01/2023
January 28, 2023 at 9:07 am |
Toni here, script works great. I had no idea Photoshop went 2 levels up. I feel I updated just recently…. After updating to latest it works.