We help IT Professionals succeed at work.

separating multiple images from one file with slices

Medium Priority
Last Modified: 2010-04-03
I have a large number of scans which are very similar. They are all approximately 8-1/2" x 11" in size and contain a bunch of objects which are mainly rectangular, all on a black background. Imagine several photos were placed on a scan bed, and all scanned at the same time into one big file. My job is to separate the scans out and save them with specific filenames.

I do not do the scanning myself, I am provided with the files, so doing this at the time of scanning is not an option. I need a way to work with existing scanned files.

The way I do this currently is to use the Slice tool to draw a box around each object, then double-click the Slice to give it the appropriate filiename. Then I do a "save for web" (this is for a website), which then saves all the various objects with the correct filename. I simply delete the other, miscellaneous slice files that Photoshop generates, and I now have a useable set of graphic files.

I'm wondering if there is any software or techniques in Photoshop which will save some time on the first part of this, drawing all the Slice boxes. It seems there should be some programmatic way of determining the boundaries between the black background, and inserting a bunch of slices which I can then tweak, rename, and save out of Photoshop. This would save me a lot of time, since there are nearly 1000 files of this type which I need to separate in the course of a year.

Thank you.
Watch Question

yes. the magic wand tool or the magnetic selection tool.

Video tutorial for creating a vector mask



Brad BansnerWeb Developer


OK, I understand that the magic wand will select the multiple images, but how do I then convert that into Slices? The tutorials you posted don't seem to show how to do that.

You create a photoshop action of one of those techniques above, then create a batch process that uses the action u made to  do it all for you:

How to automate tasks:


Batch process:



Sorry about that. Slicing is used mainly for website design. So all the tutorials I have are for that.

here's a tutorial on slices:


Brad BansnerWeb Developer


You are sending tutorials about slices, but not really answering the question.

Ok. I was suggesting that maybe you could create a action of what you have been doing previously.  Then create a batch process to automatically do it.

I don't think there is a way to do exactly what you want, because  the scanned objects would need to be in the exact location everytime in order for it to work perfectly.

If the images are in just about the exact location everytime, creating a batch process would work prefectly.  Otherwise what your currently doing is probably the best way.

But for pages with one object, you could easily make an action to select the object, then make a batch to apply the action and auto-save.

bbdesign, I think you came up with a pretty creative solution. My hat's off to you. The only way that an action might work is if all of the images are the same size on each scan and in exactly the same location.

I would probably use a cut and paste approach. When you open a new file (command/contron N) the size of the file is automaticly set to the size of the image in the clipboard. I would draw a marquee, command/control X the image, command/control N (enter) an new page, command/control V the image down, command/control S and enter the new file name. Command/control W and move on to the next image.
If all of the images are the same size, you can save a tiny amount of time by setting the marquee to set size. Then you only have to worry about placement (by holding down the space bar)
Yes, the job is long and tedious, but if you learn your shortcuts (like we all should do) I think that you can knock these out in about a quarter of the time it would take to slice and dice.
Purhaps not. but that's my only suggestion.

David B
Brad BansnerWeb Developer


Unforunately, they are all of varying sizes. I guess I was hoping there was some way to do a Magic Wand, expand the selection, and then automatically convert those "shapes" into Slices. I guess it can't be done, maybe someone should write a plugin to do that someday.
Most Valuable Expert 2013

Just speculating, haven't tried this...

Can you do a magic wand on the black area, invert the selection (so now all that is not black is selected), and then save for web?

Then maybe you can determine if there's one corner or edge where there consistently is black, and automate from there...
Brad BansnerWeb Developer


No, that doesn't do it. I guess there is no way to convert a selection into slices.

Yes you CAN convert a selection into a slice, but you have to do an in between step first.

Make your selection, cut (cmnd/ctrl-C) and paste (cmnd/ctrl-V) and the selection will be moved from the origional layer to a new layer. This layer can be promoted to a layer slice.

But you may not have to.

You can use the File/Scripts.../Export Layers to Files command to create individual files with each layer. You can make this ever task even faster by making a just rough selections with some of the black showing in the top left or lower right corner each time, then using an action to trim the files (Image/Trim...) and crop out all of the black automaticly.
Brad BansnerWeb Developer


Interesting ideas. I don't think any of these will be quicker than using the manual slice method, because there may be 30 individual items I need to name and save in the same image. However, your ideas are helpful and I'll award the points if you can answer this...

One thing that might help is if I could do the selection as you describe, and then have the Slice tool snap to the selection. I can't seem to get it to snap in that way, if I could, it would speed up the process a lot.
The following is from PhotoShop help --->  Designing Web Pages > Creating and viewing slices> Creating layer-based slices

Creating layer-based slices

      When you create a slice from a layer, the slice area encompasses all the pixel data in the layer. If you move the layer or edit the layer's content, the slice area automatically adjusts to encompass the new pixels.
 A layer-based slice is updated when the source layer is modified.

      Layer-based slices are especially useful when working with rollovers. If you apply an effect to the layer--such as a drop shadow or glow--to create a rollover state, the slice automatically adjusts to encompass the new pixels. However, do not use a layer-based slice when you plan to move the layer over a large area of the image during an animation, because the slice dimension may exceed a useful size.

To create a slice from a layer:

   1. Select a layer in the Layers palette.
   2. Choose Layer > New Layer Based Slice.

 Layer based slices automaticly crop to the image. If you don't have any extra black around the image, your slices will export cleanly. Otherwise, do a batch with the trim command.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Brad BansnerWeb Developer


Interesting, I'll have to play around with this a bit to find the most useful application of these ideas. Thanks!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.