What's new

How to slice multiple images


martin05rc

Member
Messages
8
Likes
0
Using CS4

I have about 200 PNG's that I need to slice exactly the same way. I know how to slice one image. I'd like to automate slicing all 200 with the same slice positions, sizes and settings.

This is not for web design but rather for iOS game development where I need to cut-up a sequence of images representing an animated sequence into the individual pieces that need to be animated.

I'd appreciate a shove on the right direction on this one. Thanks!
 

the cute

Well-Known Member
Messages
125
Likes
18
Slice every image to multiple part with exact size or crop them all to one size ???
 

martin05rc

Member
Messages
8
Likes
0
Slice every image to multiple part with exact size or crop them all to one size ???
It's an image of a cartoon face. I need to cut out the eyes, eyebrows, nose and mouth into separate PNGs. I have 200 PNGs of the face going through different expressions.

Ideally what I need to end-up with is something like this:

nose_000.png through nose_200.png
right_eye_000 through right_eye_200.png
etc.

I have utilities to handle renaming outside of Photoshop. What I am having trouble with is in batch processing the extraction of the same six slices out of 200 different images.
 

the cute

Well-Known Member
Messages
125
Likes
18
alrighty, you may have to try this : (i didn't test it myself so you have to do it over and over again until you get it straight :
First, create an Action that tells Photoshop what to do with each file:
Open the first image of your series in Photoshop.
Go to Window->Actions
At the bottom of the Actions pallet, click on the "Create New Action" button (next to the trash can). Name the file and hit "Record"
Do to the image what you want--crop, size, whatever. Just make sure you do only what you want to be done to all of the images.
Save the image to a new folder (don't save over your originals--you may have to try this a few times to get it just right).
Close the image THEN click the square Stop button on the Actions pallet.

Apply the Action through a Batch Process:
Go to File->Automate->Batch...
Choose the Action you just recorded from the drop down menu at the top
Select the folder where your original images are (you've already told Photoshop where to save the image in your action, so you do not need to set it)
Click OK

Photoshop will start flying through your files, repeating the steps you recorded. You should find all of the new files in the folder where you saved the first one when it's done.
 

martin05rc

Member
Messages
8
Likes
0
Right...batch processing and using rectangular markees to crop out each chunk of the image and save. I was hoping for something more elegant, like setting up the slices with the slice tool and somehow being able to apply the same slice configuration to a series of images.
 

martin05rc

Member
Messages
8
Likes
0
So you solved the problem? ^^
Yes, by using six separate actions. Each action crops a portion of the image with the rectangular markee tool and then saves the cropped image. A batch process runs through all the files in the directory. I then use another tool to batch rename the cropped files as needed. A total of six batch runs followed by six batch renames gets me what I was after.

I was hoping that there could be a more elegant solution. It'd be nice to be able to save a slicing configuration and then apply it in batch form to a group of files. You an almost get there by recording an action in which you define and apply the slices. And you can go on and run a batch with that action. The problem is that every single slice is named exactly the same. Every time the batch runs the action on a new file the slices are saved over the prior slices. At the end of processing 200 files you have one of each slice instead of 200 of each slice.

There has to be a way to do this...anyone know?
 

the cute

Well-Known Member
Messages
125
Likes
18
Yes, by using six separate actions. Each action crops a portion of the image with the rectangular markee tool and then saves the cropped image. A batch process runs through all the files in the directory. I then use another tool to batch rename the cropped files as needed. A total of six batch runs followed by six batch renames gets me what I was after.

I was hoping that there could be a more elegant solution. It'd be nice to be able to save a slicing configuration and then apply it in batch form to a group of files. You an almost get there by recording an action in which you define and apply the slices. And you can go on and run a batch with that action. The problem is that every single slice is named exactly the same. Every time the batch runs the action on a new file the slices are saved over the prior slices. At the end of processing 200 files you have one of each slice instead of 200 of each slice.

There has to be a way to do this...anyone know?
duude, when your recording the action, i mean the first action don't save the sliced image in the same folder of the original one, in the same action record that you save the sliced image in a different folder, and the batch will save the image into that different folde .. the batch do what you told him not what you want ..
try again but when saving the sliced image save it in a another folder call it "sliced pictures" for instance ..
good luck mate
 

martin05rc

Member
Messages
8
Likes
0
duude, when your recording the action, i mean the first action don't save the sliced image in the same folder of the original one, in the same action record that you save the sliced image in a different folder, and the batch will save the image into that different folde .. the batch do what you told him not what you want ..
try again but when saving the sliced image save it in a another folder call it "sliced pictures" for instance ..
good luck mate
That's exactly what I did. Perhaps I failed to clearly explain what the issue might be. It doesn't matter where you save the images, each time the slice tool runs in a batch run it will overwrite the slices from the prior run with new slices having the same names.

Instead of ending-up with this:

mouth_1.png
through...
mouth_200.png

In other words, 200 different files.

you only have:
mouth_1.png

In other words, one file that got overwritten 200 times. This file is actually the mouth from the last file that ran through the batch, in this case file number 200.
 

the cute

Well-Known Member
Messages
125
Likes
18
that's weird !! it worked with me perfectly !!
listen mate, watch this tutorial :
http://www.youtube.com/watch?v=lcZp2h5WXdA
it a good one and if you do it step by step your defintely gonna have the result that you wanted .
and i say mooooostly you didn't save the croped file as a psd ..
anyway just watch the tutorial and you'll be happy in about 5 minutes :naughty:
 

martin05rc

Member
Messages
8
Likes
0
that's weird !! it worked with me perfectly !!listen mate, watch this tutorial :http://www.youtube.com/watch?v=lcZp2h5WXdAit a good one and if you do it step by step your defintely gonna have the result that you wanted . and i say mooooostly you didn't save the croped file as a psd ..anyway just watch the tutorial and you'll be happy in about 5 minutes :naughty:
Again. I'll apologize for perhaps still not being clear about this. I can --and I have-- accomplished the desired output by applying actions in a batch to sets of 200+ images. This works fine and it results in 200+ files per section being cut out. However, this required SIX different actions to be recorded. Furthermore, the actions use the RECTANGULAR MARKEE tool to crop the image and extract the desired portion.

The action goes something like this:

"Set Selection" - This is the rectangular markee
"Crop"
"Save" - Saving to a different directory
"Close"

That's it. Six of these with different sizes and position for the rectangular markee and I was done. I had to run 200 files through the six different actions in batch mode to get what I wanted. In between each run I had to rename the resulting files or they'd get overwritten with the output of the next action's batch run. No big deal.

What I am asking for is a way to do this with ONE batch run, not six. And, further to that, I am trying to determine if this can be done by using the slicing tool rather than the markee-then-crop.

The slicing tool would be nice in that, in one document, you could define all of the required cutouts and then have all 200 (or more) files batch-processed in one run.

This doesn't seem to work now because the "Save for Web and Devices" tool will overwrite the files from the prior run.

Let's say you need to slice each image into six sub-images. If you have 200 source images you should end-up with 200 x 6 or 1200 sub-image files at the end of the process. Right now, if I try to use the "Slice" tool in combination with "Save for Web and Devices" and a batch the end result is SIX files, not 1200. Each run simply overwrites the prior runs' files with the exact same name. Not the desired result.

Perhaps this clarified it for you?
 
Last edited:

the cute

Well-Known Member
Messages
125
Likes
18
can't you record the 6 action in a same "action film" ??
 

martin05rc

Member
Messages
8
Likes
0
can't you record the 6 action in a same "action film" ??
I'm not sure what an "action film" might be. Are you suggesting that I make a single larger action that includes all of the steps that the six individual actions perform now?

Well, yes. You'd have to output each sub-action to a separate directory and still go and rename the files manually.

I was hoping that someone might know of a way to do this with slices. This would be a far more elegant and universally maintainable approach to the problem. I guess it can't be done.

Thanks for your help.
 

the cute

Well-Known Member
Messages
125
Likes
18
that's far for my knowledge !! still ,wait to someone who has knowledge on action and stuff !!
i'm sorry i couldn't be more helpful !!
 

Top