Batch Processing: Save for Web

LJ
Posted By
lin_jiang
Dec 27, 2003
Views
518
Replies
10
Status
Closed
I have about 2000 pictures from my digital camera, and I want to use Photoshop’s Automate->Batch to size the images to thumbnail images at 120*100 and save the new image as thumb_filename.extension.

I tried two slightly different approaches.

First one;
a.Create a new action: thumbnail.
b.Start recording.
c.Open an image
d.Resize it to be 120 * 100
e.Save As (the same name into another folder)
f.Stop recording

When I run the batch on a folder, it worked very well. My files were saved with the filenaming convention that I specified.

However because I want to put these images online, I am concerned with the size. Instead of Save As…, I want to use the Save for Web…

I repeated the steps a through d.
After resizing, I clicked on File–>Save for Web, changed the settings for the optimization. I then closed the original image. When asked if I want to save it, I clicked Yes. (I varied the steps here for different times. Sometime I clicked No.)

But this time when the batch job is finished, the new files either don’t have the new filenames that I specified or they did not get changed at all.

I understand why these happen, but I just want to know if there is a way to include the Save for Web… step into an action that has multiple saves?

Thank you very much!

lin

MacBook Pro 16” Mockups 🔥

– in 4 materials (clay versions included)

– 12 scenes

– 48 MacBook Pro 16″ mockups

– 6000 x 4500 px

Y
YrbkMgr
Dec 27, 2003
Lin,

I presume this is version 7. Here’s how *I* would tackle it. Don’t use "OPEN" in your action.

Open a dummy image and record a resze using File|Automate|Fit Image. Using this, you specify the maximum hieght or maximum width of your image. Stop recording. Call this action something like Fit for Web.

Start recording a new action, call it Save For Web. Go through the process of saving for web with your desired params. stop recording.

Set your image back to it’s original state using the history pallet.

Start recording a third action called Resize and Save for Web. While recording, play the Fit Image action, then play the Save for Web action, and carry it out through completion. Stop recording.

In the actions pallet, make sure the Save for Web action (the second action you created) has the dialog toggled OFF – that’s the square next to the action name.

Close your image, and make sure you have created a destination folder to contain your newly resized images.

You are ready to batch.

File|Automate|Batch

Action to run: Resize and Save for Web
Source: Folder
Choose: pick the folder containing your source images
Destination: Folder
Choose: pick the folder where you want the new images to go Override Save As information: CHECKED

Optionally choose a naming convention.

When you hit "go", all images in the source folder will open one by one, be resized, and saved per your SFW settings, then close.

Peace,
Tony
DR
Danny_Raphael
Dec 27, 2003
Tony:

Perfect timing. Save for the Web and actions continues to puzzle me.

I know you do this stuff all the time, so there must be some subtle things I’m not getting here. Help me see the light…

a. Please elaborate on the value add / benefit of splitting the process into two actions executed by another action invoked through Automate > Batch. I understand Automate > Batch enables you to override Open and Save (and Save As…) cmds and specify source and destination folders, but why an action for the resize and another for the SFTW?

b. Since Save for the Web records as an Export command, in my tests ‘Override "Save As" Commands’ doesn’t seem to have the same desired effect (preserve file characteristics, but ignore file name and folder recorded in the command) as it does on a vanilla, unchecked (no dialog) Save As command. I’m getting a Save for Web dialog for each image, even with the show dialog modal control turned off. Ditto when Save for Web is inserted via Insert Menu Item.

c. Specifying custom file name settings in Automate > Batch has no effect for me on the ultimate file name outcome, regardless of the ‘Override "Save As" Commands’ setting. Ditto when Save for Web is inserted via Insert Menu Item.

Thanks again for helping me better understand actions and batch automation.

~Danny~
Y
YrbkMgr
Dec 27, 2003
Danny,

You aren’t alone in your puzzlement. Through version 7, there are some idiosyncracies that I haven’t noodled out yet (time v. effort), but have found a "best practices" routine for most of my automation techniques.

why an action for the resize and another for the SFTW?

Part of my "best practices". Functionally, there’s no reason not to have a single, all inclusive action. I find the actions pallet a nightmare to naviate so I organize actions according to functions: resizing, saving, etc and in button mode use a dummy action name as a divider within a set. For me, it’s easier to create separate steps to avoid troubleshooting difficulties since the actions are broken into smaller chunks – just look at the sfw action. Scrolling your action pallet to find a specific issue is, IMO, ridiculous, so I like to break them up into manageable chunks and then "nest" actions.

An added benefit is that if you organize your actions well (and most of us don’t), you can call previously created actions without having to recreate them. For example. I have an action that does what I call a standard "autolevels, gaussian blur, unsharp mask". After that I have several routines that call that function first, then perform other tasks – maybe high pass sharpening, or an edge mask followed by a blur and then levels adjustment and then a sharpen. But my first routine is the AL/GB/USM. I do the same thing with resizing to a specific ppi – first resize, then run my al/gb/usm, then optionally run other actions. Since these are common routines, I find it easier to call them and nest them to reduce clutter and make troubleshooting easier.

Other than organizationally, there is usually no inherent benefit. I have found fewer problems with nesting actions but I cannot say why, save for the possibility that it’s easier to manage and thus troubleshoot.

That’s a long-winded way to say that it may be simply personal preference.

in my tests ‘Override "Save As" Commands’ doesn’t seem to have the same desired effect (preserve file characteristics, but ignore file name and folder recorded in the command) as it does on a vanilla, unchecked (no dialog) Save As command.

Override Save As functionally passes saving routines from the action to the Batch dialog box. That includes filename AND location. With SFW, however, it DOES NOT pass this function to the Batch dialog. Since SFW is an Export function, it behaves badly in terms of consistency as it relates to batching. The destination used is whatever the action calls and the file naming remains unaffected by the batch dialog.

I presume that the reason for this is that since SFW is an export command, and offers the opportunity to be mac or unix compliant, it takes control to make sure it puts in the dashes where %20 would exist to represent a space. I guess it’s a situation of which rules to follow, and the developers erred on the side of "if you use sfw, then let it have control". <shrug>.

So why did I tell him to check the box and optionally choose a naming convention? Mostly habit – the naming convention I should have known better, but the Override Save As box is simply habit. Without it checked, file saving routines remain in the domain of the action, and I don’t usually do that. So it was really an error on my part, although not with any real negative consequences.

I’m getting a Save for Web dialog for each image, even with the show dialog modal control turned off. Ditto when Save for Web is inserted via Insert Menu Item.

This I cannot understand. I have heard reports of it from others, and even reproduced it once. My thought at the time was that it may have something to do with whether you nest the SFW action or simply have it part of a long action. I just tested it, and that’s not true. Either nested or as part of a long action sequence, I do NOT get the SFW dialog.

I wonder if when you are testing, when you record the action, do you bring it all the way to completion? That is, you actually save the file while recording, then stop the action? That’s what I do.

In sum, the behavior of SFW as it relates to batching is buggy – that does NOT mean it has bugs, it’s just that there are some overlapping rule sets that are either not documented or that I simply don’t understand. That’s about as much as I can offer, but am happy to work with you on the SFW dialog issue. That is to say, If you really want me to reproduce it again, I will work on it and see if I can’t find out why it shows in some situations but not others.

Peace,
Tony
DR
Danny_Raphael
Dec 28, 2003
Tony:

Again your words turned on a few lightbulbs and inspire me.

– – – – –

RE: Best practice of having action modules performing discrete functions and calling (nesting) them in other actions

Brilliant. More "TonyK" content for forthcoming Actions Tutorial!

– – – – –

RE: SFW nuances

See discoveries that follow.

– – – – –

RE: SFW – Danny always gets a dialog box (I wuz wrong)

I’m now able to execute Export (SFW) command w/o SFW dialog as long as the dialog modal control is off.

Too much eggnog or something.

– – – – –

Discoveries / confirmations:

* If SFW command was inserted into the action using Insert Menu Item, you get a SFW dialog no matter what. No surprise. That’s by design.

* If the folder specified in the SFW command has images in it and you process the same folder of source images via Automate > Batch, the "Replace or cancel" dialog displays. Again, no surprise.

* No matter what combination of settings is chosen in the Automate > Batch dialog, the folder specified in the Export command is the one where images to which the SFW parameters are applied are saved.

* In Automate > Batch if Folder is chosen for the Destination option, a second copy of the images is placed in the destination folder, albeit w/o application of the SFW settings. The file names are assigned according to choices made in the 6 File Naming text boxes.

Situation:
– Automate > Batch Destination folder = Export folder – Source file names are all in lower case or UPPER CASE
– "document name" + "extension" or "DOCUMENT NAME" + "EXTENSION is specified in the File Naming section

Result:
Automate > Batch will overwrite files created by the Export command, which uses the original file name.

Bottom line:
For Destination images specify a file naming convention <> to original file names OR specify a Destination folder <> to the one specified in Export.

Overall a very educational exercise. Thanks again, Tony, and to you Lin for posting the original question.

~Danny~
Y
YrbkMgr
Dec 28, 2003
Danny,

In Automate > Batch if Folder is chosen for the Destination option, a second copy of the images is placed in the destination folder, albeit w/o application of the SFW settings.

Unable to duplicate this. No second copy is being created. Hmmm…

Peace,
Tony
DR
Danny_Raphael
Dec 28, 2003
Tony:

In the File > Automate > Batch dialog, try changing file naming options from "Document Name" + "extension" to something else, e.g., "DOCUMENT NAME" + "EXTENSION".

Images saved by Export command will have file names in the same format as the original source images; the ones saved by FAB will all be in upper case.

I get both copies in the folder designated by Export, the same folder specified in FAB Destination.

~Danny~
Y
YrbkMgr
Dec 28, 2003
I get both copies in the folder designated by Export, the same folder specified in FAB Destination

I’ve tried it and it’s not giving me duplicates. It’s total SFW control in terms of fn/destination. Based on what I see, the destination selection has no effect on SFW. I don’t get it. I’m going to carry out some more controlled tests tomorrow, but whether I specify a destination directory OR a file name (including using your upper case example) in the batch dialog or not, I get exactly what I would expect – the files created only by SFW, and only in the dir specified in the SFW action. <shrug>.

Peace,
Tony
DR
Danny_Raphael
Dec 29, 2003
Mystery solved:

After collaborating with Tony off-line, here are the final results for playing an action that contains an Export (save for the web) command under File > Automate > Batch (FAB):

Normally under FAB you can specify a Destination folder and have control over output. This is not the case if an Export command is present. Processed images are placed in the folder specified in the recorded Export command.

Custom settings specified in the File Naming section of FAB have no effect on files saved by the Export command.

Normally under FAB if there is no Save As… command in the action you leave "Override Action "Save As" Commands’ unchecked and check it if a Save As… command is present. When an Export command is present (no Save As…), checking Override Action "Save As" Commands’ is a good idea. Doing so prevents FAB from writing a second copy of the file, which may overwrite the copy written by Export.

In other words, if you have an Export (Save for the web) command in an action invoked by File > Automate > Batch
* Forget about alternate file names. Id you want different file names, use the batch rename function in the File Browser or use an alternate application such as ThumbsPlus, IrfanView, etc.
* Files will be placed in the folder specified in the Export command regardless of what’s specified in the Choose Destination dialog.
* Be sure to check ON "Override Action "Save As" Commands’ — even though a Save As… command is not present in the action.

Whew.

Thanks, Tony.

~Danny~
Y
YrbkMgr
Dec 29, 2003
No, thank YOU Danny. Good detective work, and excellent follow through.

Peace,
Tony
BC
Bradley Chapman
May 6, 2004
Tony, this worked beautifully. Thanks so very much!

Must-have mockup pack for every graphic designer 🔥🔥🔥

Easy-to-use drag-n-drop Photoshop scene creator with more than 2800 items.

Related Discussion Topics

Nice and short text about related topics in discussion sections