Posted by Bret Edge on October 18, 2006 at 11:57 AM
I'm in the process of assembling a large submission for my stock agency and I am curious to know if there is a way to resize & sharpen a large batch of photos automatically in PS CS2. Anyone have any ideas?
Thanks!
Posted by James H Egbert on October 18, 2006 at 12:16 PM
You know, I for one would love to know if this can be batched in Adobe Camera Raw when converting from RAW to Tiff and Jpeg files all at the same time.
Posted by Craig Schultz on October 18, 2006 at 12:26 PM
Bret, I don't have CS2, but in PS CS you can do this. Just create an action that will resize and sharpen your photos as you want. Then use the batch processor to point to the action and folder with all the unprocessed photos. It gives you the option to output into a second processed folder if you want.
The issue with this method is that all photos must be the same orientation (portrait or landscape) for the resize to work correctly. You could work around this by placing all landscape images in one folder and all portraits in another and running the batch processor twice. Also, sharpening is often not best applied universally to a large assortment of images.
Posted by Mark Ferguson on October 18, 2006 at 12:31 PM
Brett,
The process you take really depends on how much resizing and the process you use for sharpening. Here is an example of how I do it. In this case I want to process a batch of raw images suitable for printing:
1) Open CS2 and create a new action
2) Open one of your files (in my case I open a RAW file)
3) Apply capture sharpening (I use Photo Kit Sharpener by Pixel Genius)
4) Resize your image to the desired target size (depending on the target size and destination you may need to uncheck resample, change the PPI, recheck resample, and then resize based on a 70% percentage). Repeat this until you get to the size you want. I use bicubic sharpening when downsizing like this. In my case I know that all images are of similar capture size and therefore I will stairstep resize a specific number of times. You may also want to use the Automate->Fit Image to see a maximum width/height size.
5) Perform output sharpening (again I use Photo Kit Sharpener - output sharpening based on the output type and size of the image)
5) If required convert to a sRGB colorspace
6) Convert to 8-bit
7) Save As JPEG (Quaility 10 or higher)
8) Close the file
9) Stop the recording of the action
Next go into Bridge and
10) Select all the images you want to process
11) Select Tools > Photoshop > Batch
12) Select the Action Processing set and specific action you recorded above
Select Bridge as the source
Override Action Open commands
Suppress File Open Options Dialogs
Suppress Color Profile Warnings
Specify the output folder where the images should be placed when complete
Override Action Save As Commands
Set up your desired file naming
Click OK
The images will be processed and placed in your destination folder.
Since I'm not sure of the agency's submission requirements you'll need to tweak your action to match the size, colorspace, bit depth, etc.
Hope this at least gives you a general idea of the steps you'll need to process everything. I've used a similar process to batch processes several hundred images overnight so that they are ready for print the next morning.
Mark
Posted by Mark Ferguson on October 18, 2006 at 12:37 PM
As for RAW->Tiff->Jpeg you can do the same thing. In the above action I showed above the order would be:
Open RAW (I use ProPhoto, 16 bit)
Capture Sharpen
Save as 16 bit Tiff
Resize as necessary
Output sharpen
Save as JPEG
This sounds like a workflow that would batch process RAW files then create a TIFF that would ready for additional editing in Photoshop and also create a JPEG for preview use. Again depending on the purposes of the TIFF and/or JPEG you can modify/tweak the above as needed.
Mark
Posted by Bret Edge on October 18, 2006 at 12:38 PM
Awesome! Thanks for the information, Mark and Craig. I'll try it out shortly.
Posted by Ken Wyatt on October 18, 2006 at 12:51 PM
Brett, are you sure your agency wants them all sharpened? Usually, this is the last step following the ultimate resizing based on the client's needs.
Just a thought...
Ken
Posted by Bret Edge on October 18, 2006 at 12:56 PM
Ken:
For this submission they want mildly sharpened low-res jpegs. Once they choose images I'll send unsharpened hi-res files for the reasons you stated. Thanks for the reminder!
Mark,
what is meant by override and supress? Whenever I try batch I always get an error, this or that command is not available.
Another trick bret for both orientation is using fit image (under automate in PS7, don't know about higher version).
Posted by Mark Ferguson on October 18, 2006 at 2:08 PM
Override and suppress is settings when using Bridge to batch. It essentially means that Bridge will handle the file opening task so you won't have to. The suppress item is related to color spaces. If you are opening a file with a colorspace defined with something other than your standard working colorspace it can pop up a dialog if you have this behavior set as a preference in Photoshop.
As for getting an error that a command isn't available....double check to insure the command you are trying to run is compatible with the bit depth of your image. For example if you are trying to use a 8-bit command/plug-in on a 16-bit image. Also, I've had problems when you try to run a command in the action on a layer that it doesn't know what to do with. For example running Photo Kit Sharpener on an adjustment layer.
I'm still using PS7 and whenever I try batch under automate I encounter this error (comman not available). Source files are 8 bit.
Posted by Craig Schultz on October 18, 2006 at 2:36 PM
Prashan, this could be due to the layering in your psd file. If the command needs to work on a layer with data (i.e. pixels) or if the command needs to work on a normal layer vs the background. Usually you want to flatten your layered file first or ensure all images have the same layer scheme which is compatible with the action you are running.
Craig
Posted by Nat Coalson on October 18, 2006 at 3:44 PM
By far, the easiest way to do this is in CS2 to:
1) record an action that only applies sharpening or unsharp mask. You should do this on a file that is the size and resolution that you will ultimately want so you get exactly the amount of sharpening you want; then
2) run the Image Processor script and include your sharpening action.
Image Processor will do everything else, including resizing, flattening and even raw conversion as necessary (just make sure you have your raw conversion settings already applied). You can save out tif, jpeg and/or psd's from Image Processor all at one time.
Image Processor is new to CS2.
Posted by Brent Murphy on October 18, 2006 at 3:55 PM
I do this all the time with PS7 and above. And as Prashan noted, use Automate>Fit Image as a part of your action to resize images regardless of orientation.
First, create a new action. Start by opening one of your images, create a new action, and start recording. Then do everything you want to do. My basic resize actions consist of only a few steps: Fit Image, USM, Save and Close. Once your action is recorded, use Automate>Batch to run this action on a folder of images. Make sure your Source and Destination folders are different. Also, make sure you select Override Action SaveAs Command. If you don't select this, the Batch process will always create your resized files in the folder you used when you created that action. Checking this box allows the batch process to save to the Destination folder.
Another thing you may want to do, for more control, is allow the action to pause and open dialog boxes for you. Next to each command in the Action list is a little box. Most are empty. If you click this box, a little icon appears. This tells you that the action will pause there and let you adjust settings that are a part of that command. For example, instead of using the USM settings you used on the image when you recorded the action, the USM dialog box pops up, allowing you to adjust the settings for each image. I don't use this option often, but it occassionally comes in handy.
Posted by Bill Pelzmann on October 18, 2006 at 8:30 PM
In CS2 I've been able to automate just about everything with actions, except optimizing the file size. What am I missing? Save-As appears limited to using a fixed quality setting. Save-For-Web also seems to require manual intervention to select the optimum quality. So, is there any way to automatically save files to a max size, such as 200 mb ? Or, will I need to stop the action and manually adjust each file?
Posted by Brent Murphy on October 18, 2006 at 8:46 PM
I haven't been able to get Save for Web to work correctly with an action. That's why I just stick with SaveAs in my re-sizing actions.
Posted by Mark Ferguson on October 18, 2006 at 10:07 PM
Also, one note relative to Save As versus Save for Web.... Save As preserves your meta data (ie - Copyright, etc.) while Save for Web will strip it out. For this reason I always use Save As
Mark
Posted by Bill Pelzmann on October 18, 2006 at 10:21 PM
OK, so with Save As, is there any way to optimize file size automatically - or do you just select an image quality level that gets most of your files under a fixed limit?
Posted by Nat Coalson on October 19, 2006 at 1:14 AM
File > Scripts > Image Processor
Posted by Bill Pelzmann on October 19, 2006 at 2:41 PM
Nat,
I must be blind. I only see a fixed image quality option in Image Processor. It allows you to fit to a max pixel dimension. I want the same ability to fit to a max file size, by automatically selecting the max image quality. I only see the option to pick a constant image quality.
Thanks for your help.
Posted by Nat Coalson on October 19, 2006 at 7:45 PM
Bill-
On the File Type section, near the Save as JPEG checkbox, there is a Quality text entry field. Mine also shows a checkbox for Convert Profile to sRGB... see below.
Which version of PS are you using?
Posted by Bill Pelzmann on October 19, 2006 at 8:29 PM
Nat, your screen is exactly what I see in CS2.
So, in this example you have JPEG quality set at 7.
That is fixed for each image. So, the output file size will vary depending on the content of each image.
The output file size wil NOT be maximized to fit a user specified limit, i.e. 200 kb.
There is NO place that I can see to specify a file size - only a JPEG quality.
My goal is to automatically process a folder full of images to maximize the typical posting guidelines: max dimension 720 pixels, max file size 200 kb.
I ran Image Processor on a folder of 85 images with resize to fit at 720 and image quality 5.
The results were file sizes that ranged from 52 kb to 204 kb.
Posted by Nat Coalson on October 19, 2006 at 8:40 PM
Ah - I understand now. Sorry for my confusion.
As far as I know, there is no way to specify a file size limit on any of the save operations in Photoshop.
If you know of a way to do this in Photoshop outside of Image Processor, you can add it to an action. And I'd be very interested to know where that setting is. And if it doesn't exist in Photoshop, it should...
Posted by Bill Pelzmann on October 19, 2006 at 8:48 PM
Darn! I was certain YOU had the answer.
On well, at least I didn't manualy optimize 85 images only to find out there was a simple action available.
Thanks for your time.
Posted by Nat Coalson on October 19, 2006 at 11:10 PM
Bill-
Glad you pressed the issue; I found the answer... there is a way to optimize to a specific file size in Save for Web. It's under the flyout menu above the other file settings.
I found the answer to this in the Photoshop Help system, doing a search for "file size".
Quite an obscure place to put it, and makes me surprised I've never used it before. Thanks for helping me learn something new!!
Posted by Bill Pelzmann on October 20, 2006 at 1:03 AM
WOW ! I owe you big time !
My attempt at using help never got there, and if I ever clicked on that obscure @#$*# button, I never saw the option.
I love the power of Photoshop, and it is fun always learning new things, but some times you really wonder what those interface designers were smoking.
Posted by Brent Murphy on October 20, 2006 at 1:52 AM
Just an FYI, though. As Bill already pointed out, I don't believe including Save For Web to optimize a file size will work on a batch operation. What I've found is that when you set the Optimize to File Size option, Save For Web will automatically adjust the JPG compression level to meet that file size FOR THAT IMAGE. For example, it may set the compression to something like 7.2. When you complete the action creation, then try to use it in a batch operation, it will use that 7.2 compression number, not the 200k you wanted. So, your images will still come out with different file sizes.
At least, that's how it seemed to work for me on PS7. Haven't tried it again with CS2, so maybe they've tweaked it.
As for Save for Web stripping out the metadata, that's precisely the reason to use Save for Web. Stripping out the metadata is what allows Save for Web to create smaller file sizes than Save As. If I'm trying to create images for web use, with the smallest (or specific) file sizes, I would always use Save for Web. There is no reason for the file to include that extra info on a web image. This is especially true for things like little avatars. When you're limited to a 15k image, if you don't get rid of the metadata, then maybe half your file size is being taken up by information not related to the image pixels.
Posted by Bill Pelzmann on October 20, 2006 at 3:14 AM
Well, darn I'm heading to bed.
Brent seems to be correct about the different behavior in Batch mode in CS2, also.
Save for Web with Optimize to File Size works as expected on individual files.
But, when I batch it, the files are all different sizes, both under and over the specified limit.
So anybody here good at writing Photoshop VB scripts?
I'm sure Brent, Nat, and I would be more than happy to treat you to lunch for a solution
Posted by Nat Coalson on October 20, 2006 at 10:48 AM
Great points about Metadata, Brent!
It definitely is a missing feature: ImageReady won't do it either, nor will Lightroom. (I've added this as a feature request in the Lightroom Beta forums.)
In Ferguson's Batch post above, you could include the file size option in an action, by choosing to open the dialog box at that step, but then you'd still have to do it for each one as it came up.
Discussion
28 repliesThanks!
The issue with this method is that all photos must be the same orientation (portrait or landscape) for the resize to work correctly. You could work around this by placing all landscape images in one folder and all portraits in another and running the batch processor twice. Also, sharpening is often not best applied universally to a large assortment of images.
Also check out XBatch
Craig
The process you take really depends on how much resizing and the process you use for sharpening. Here is an example of how I do it. In this case I want to process a batch of raw images suitable for printing:
1) Open CS2 and create a new action
2) Open one of your files (in my case I open a RAW file)
3) Apply capture sharpening (I use Photo Kit Sharpener by Pixel Genius)
4) Resize your image to the desired target size (depending on the target size and destination you may need to uncheck resample, change the PPI, recheck resample, and then resize based on a 70% percentage). Repeat this until you get to the size you want. I use bicubic sharpening when downsizing like this. In my case I know that all images are of similar capture size and therefore I will stairstep resize a specific number of times. You may also want to use the Automate->Fit Image to see a maximum width/height size.
5) Perform output sharpening (again I use Photo Kit Sharpener - output sharpening based on the output type and size of the image)
5) If required convert to a sRGB colorspace
6) Convert to 8-bit
7) Save As JPEG (Quaility 10 or higher)
8) Close the file
9) Stop the recording of the action
Next go into Bridge and
10) Select all the images you want to process
11) Select Tools > Photoshop > Batch
12) Select the Action Processing set and specific action you recorded above
Select Bridge as the source
Override Action Open commands
Suppress File Open Options Dialogs
Suppress Color Profile Warnings
Specify the output folder where the images should be placed when complete
Override Action Save As Commands
Set up your desired file naming
Click OK
The images will be processed and placed in your destination folder.
Since I'm not sure of the agency's submission requirements you'll need to tweak your action to match the size, colorspace, bit depth, etc.
Hope this at least gives you a general idea of the steps you'll need to process everything. I've used a similar process to batch processes several hundred images overnight so that they are ready for print the next morning.
Mark
Open RAW (I use ProPhoto, 16 bit)
Capture Sharpen
Save as 16 bit Tiff
Resize as necessary
Output sharpen
Save as JPEG
This sounds like a workflow that would batch process RAW files then create a TIFF that would ready for additional editing in Photoshop and also create a JPEG for preview use. Again depending on the purposes of the TIFF and/or JPEG you can modify/tweak the above as needed.
Mark
Just a thought...
Ken
For this submission they want mildly sharpened low-res jpegs. Once they choose images I'll send unsharpened hi-res files for the reasons you stated. Thanks for the reminder!
what is meant by override and supress? Whenever I try batch I always get an error, this or that command is not available.
Another trick bret for both orientation is using fit image (under automate in PS7, don't know about higher version).
As for getting an error that a command isn't available....double check to insure the command you are trying to run is compatible with the bit depth of your image. For example if you are trying to use a 8-bit command/plug-in on a 16-bit image. Also, I've had problems when you try to run a command in the action on a layer that it doesn't know what to do with. For example running Photo Kit Sharpener on an adjustment layer.
Hope that helps!
Mark
Craig
1) record an action that only applies sharpening or unsharp mask. You should do this on a file that is the size and resolution that you will ultimately want so you get exactly the amount of sharpening you want; then
2) run the Image Processor script and include your sharpening action.
Image Processor will do everything else, including resizing, flattening and even raw conversion as necessary (just make sure you have your raw conversion settings already applied). You can save out tif, jpeg and/or psd's from Image Processor all at one time.
Image Processor is new to CS2.
First, create a new action. Start by opening one of your images, create a new action, and start recording. Then do everything you want to do. My basic resize actions consist of only a few steps: Fit Image, USM, Save and Close. Once your action is recorded, use Automate>Batch to run this action on a folder of images. Make sure your Source and Destination folders are different. Also, make sure you select Override Action SaveAs Command. If you don't select this, the Batch process will always create your resized files in the folder you used when you created that action. Checking this box allows the batch process to save to the Destination folder.
Another thing you may want to do, for more control, is allow the action to pause and open dialog boxes for you. Next to each command in the Action list is a little box. Most are empty. If you click this box, a little icon appears. This tells you that the action will pause there and let you adjust settings that are a part of that command. For example, instead of using the USM settings you used on the image when you recorded the action, the USM dialog box pops up, allowing you to adjust the settings for each image. I don't use this option often, but it occassionally comes in handy.
Mark
I must be blind. I only see a fixed image quality option in Image Processor. It allows you to fit to a max pixel dimension. I want the same ability to fit to a max file size, by automatically selecting the max image quality. I only see the option to pick a constant image quality.
Thanks for your help.
On the File Type section, near the Save as JPEG checkbox, there is a Quality text entry field. Mine also shows a checkbox for Convert Profile to sRGB... see below.
Which version of PS are you using?
So, in this example you have JPEG quality set at 7.
That is fixed for each image.
So, the output file size will vary depending on the content of each image.
The output file size wil NOT be maximized to fit a user specified limit, i.e. 200 kb.
There is NO place that I can see to specify a file size - only a JPEG quality.
My goal is to automatically process a folder full of images to maximize the typical posting guidelines: max dimension 720 pixels, max file size 200 kb.
I ran Image Processor on a folder of 85 images with resize to fit at 720 and image quality 5.
The results were file sizes that ranged from 52 kb to 204 kb.
As far as I know, there is no way to specify a file size limit on any of the save operations in Photoshop.
If you know of a way to do this in Photoshop outside of Image Processor, you can add it to an action. And I'd be very interested to know where that setting is. And if it doesn't exist in Photoshop, it should...
On well, at least I didn't manualy optimize 85 images only to find out there was a simple action available.
Thanks for your time.
Glad you pressed the issue; I found the answer... there is a way to optimize to a specific file size in Save for Web. It's under the flyout menu above the other file settings.
I found the answer to this in the Photoshop Help system, doing a search for "file size".
Quite an obscure place to put it, and makes me surprised I've never used it before. Thanks for helping me learn something new!!
My attempt at using help never got there, and if I ever clicked on that obscure @#$*# button, I never saw the option.
I love the power of Photoshop, and it is fun always learning new things, but some times you really wonder what those interface designers were smoking.
At least, that's how it seemed to work for me on PS7. Haven't tried it again with CS2, so maybe they've tweaked it.
As for Save for Web stripping out the metadata, that's precisely the reason to use Save for Web. Stripping out the metadata is what allows Save for Web to create smaller file sizes than Save As. If I'm trying to create images for web use, with the smallest (or specific) file sizes, I would always use Save for Web. There is no reason for the file to include that extra info on a web image. This is especially true for things like little avatars. When you're limited to a 15k image, if you don't get rid of the metadata, then maybe half your file size is being taken up by information not related to the image pixels.
Brent seems to be correct about the different behavior in Batch mode in CS2, also.
Save for Web with Optimize to File Size works as expected on individual files.
But, when I batch it, the files are all different sizes, both under and over the specified limit.
So anybody here good at writing Photoshop VB scripts?
I'm sure Brent, Nat, and I would be more than happy to treat you to lunch for a solution
It definitely is a missing feature: ImageReady won't do it either, nor will Lightroom. (I've added this as a feature request in the Lightroom Beta forums.)
In Ferguson's Batch post above, you could include the file size option in an action, by choosing to open the dialog box at that step, but then you'd still have to do it for each one as it came up.