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 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!!!
July 15, 2016 at 2:15 am |
非常好用!但是!
当中国人用的时候要把脚本第414 和417 的 work path 改成 工作路径 后脚本就可以用了!
When the Chinese used to change the script of 417 and 414 the work path to 工作路径 After the script can use!
September 8, 2016 at 6:55 pm |
amazing thanks
September 22, 2016 at 3:52 pm |
For those of you encountering the error “The object “current document” is not currently available” using this script in CS6 (v13.0), I have just found the cause. The script will not work unless “Open Documents as Tabs” is checked in the preferences, under Interface. It seems unrelated but this is definitely why the script breaks. It’s too bad because I prefer to keep that unchecked!
This is a very useful script, hope that issue can be fixed someday. Thanks!
August 3, 2021 at 2:01 pm |
Saved me about 2 hours of work. Thank you!