Sub topic 14
Automate Batch Exports with Image Processor and Actions
This chapter assumes you can export a single image with Export As or Quick Export. You should also know how to open the Actions panel, and understand sRGB conversion, JPEG quality, and pixel dimensions from earlier chapters. Here you will automate repeated exports. You will run one set of settings across many files, and you will record your own steps as an action.
Choose the right automation tool
Photoshop offers several ways to export more than one file. They solve different problems.
| Tool | Best for | Input | Limits |
|---|---|---|---|
| Generate Image Assets | Many assets from one document | Layer and group names | One document at a time |
| Image Processor | Same resize and format for many files | A folder or open files | Few options, no custom steps |
| Actions | Any repeatable sequence of steps | The current document | Must be recorded carefully |
| File > Automate > Batch | Running an action across a folder | A folder plus an action | Needs a well-built action |
Generate Image Assets uses names such as these:
hero.jpg90%
icon-search.png
icon-search-2x.png
200% badge.png
300x300 avatar.jpgThe file extension sets the format. A percentage after a JPEG name sets quality. A prefix such as 200% or 300x300 sets the output scale or size. Use it when the source is one layered document. Use Image Processor or Batch when the source is many separate files.
Use Image Processor
Image Processor is a script that ships with Photoshop. It opens each file in a folder, converts it, and saves the result. It does not change your originals.
Open it from File > Scripts > Image Processor. The dialog has four numbered sections.
- Select the images to process. Choose Use Open Images or pick a folder. Tick Include All sub-folders to process nested folders. Tick Open first image to apply settings if the files have different color profiles and you want to set the profile before the run.
- Select location to save processed images. Choose Save in Same Location or select a destination folder. Always pick a separate folder for web output. Photoshop creates a subfolder per format, such as
JPEG, inside that location. - File Type. Tick Save as JPEG, Save as PSD, or Save as TIFF. You can tick more than one and get all of them in one pass. For JPEG, set Quality from 0 to 12. Tick Resize to Fit and enter a width (W) and height (H) in pixels. Tick Convert Profile to sRGB to convert the color profile.
- Preferences. Choose Run Action and select an action from the list. Add copyright info if you want it written to the file. Tick Include ICC Profile to embed the profile.
How Resize to Fit works
Resize to Fit scales each image so it fits inside the W by H box. It keeps the aspect ratio. It does not crop. If you enter 1600 by 1600, a 4000 by 3000 landscape image becomes 1600 by 1200. A portrait image of 3000 by 4000 becomes 1200 by 1600.
To constrain only the width, set H to a large number such as 10000. To constrain only the height, do the opposite.
Limits to know
- Output is JPEG, PSD, or TIFF only. Image Processor cannot write PNG, GIF, or WebP directly. For those formats, put the export inside an action and run that action instead.
- JPEG quality uses the 0–12 scale, not the 0–100 scale in Export As. A value of 8 is roughly comparable to a medium-high setting. Test it on a representative file.
- Transparency is lost in JPEG. Transparent areas become white or the matte color. Use PNG through an action when you need transparency.
- Upscaling is possible. If a file is smaller than the box, Resize to Fit may enlarge it. Check your smallest source files first.
Build an action for custom exports
An action is a recorded list of steps. You play it back on any open document. Actions let you export PNG or apply sharpening, steps Image Processor cannot do.
Record the action
- Open a sample image.
- Open Window > Actions.
- Click Create new action (the plus icon at the bottom of the panel). Name it, for example
Web 1600 sRGB. Click Record. - Perform the steps once, in order:
- Edit > Convert to Profile, destination space sRGB IEC61966-2.1.
- Image > Image Size, set the width to 1600 px with resampling on.
- Filter > Sharpen > Smart Sharpen if you want output sharpening after the resize.
- File > Export > Export As, choose the format and settings, and save.
- Click Stop playing/recording.
Make the action robust
Recorded actions fail in predictable ways. Check each of these before running on a large batch.
- Fixed values. If you typed a width of 1600, every image gets exactly 1600 px, including portraits. That may stretch or oversize them. Use Image > Image Size with a relative setting only when the layout allows it, or split the job into landscape and portrait runs.
- Missing layer names. A step that selects a layer by name fails on files that lack that layer. Avoid layer-specific steps in batch actions.
- Export As dialogs. A recorded Export As step may still open the dialog during playback. In the Actions panel, toggle the dialog icon (the box to the left of the step) to control whether the step pauses. Turn it off for unattended runs.
- Flattening. Add a Layer > Flatten Image step before a JPEG save if the source files have hidden or odd layers.
- Color mode. If some sources are CMYK or 16-bit, add Image > Mode > RGB Color and 8 Bits/Channel steps near the start. Otherwise the export can fail or look different.
Run it with Batch
Use File > Automate > Batch to apply the action to a folder.
- Under Play, choose the Set and Action.
- Under Source, choose Folder and select your input folder.
- Under Destination, choose Folder and select the output folder. Tick Override Action "Save As" Commands if your action saves with Save As. For actions that use Export As, the export location was recorded in the action, so check where files land after a test run.
- Under File Naming, build a naming pattern, for example Document Name plus a fixed suffix such as
-1600. - Under Errors, choose Log Errors to File. This keeps the batch running and writes problems to a text file you can read afterward.
Tick Suppress Color Profile Warnings and Suppress File Open Options Dialogs so the batch does not stop on prompts.
Combine Image Processor with an action
Image Processor can run an action after it saves each file. This works well for one extra step, such as a watermark or a sharpening pass.
Set the Image Processor sections as above, then in section 4 tick Run Action and choose your action. The action runs on the image after resizing. Keep the action short, and do not include Save or Export steps in it. Otherwise each file is saved twice.
Create a droplet
A droplet is a small application that runs an action when you drag files onto it. Create one with File > Automate > Create Droplet.
- Choose a save location and name for the droplet.
- Pick the Set and Action to play.
- Choose destination, naming, and error options, as in Batch.
- Click OK.
Drag files or folders onto the droplet icon and Photoshop launches and runs the action. Droplets suit teammates who should not open the Actions panel. Rebuild the droplet if you edit the action, because it stores its own reference to the steps.
Support responsive output
To produce several widths for srcset, run Image Processor once for each width into separate folders. Name the folders by width, for example out-800 and out-1600. Then rename the files, or let an action add a suffix, so each file name carries its width. The HTML below uses the two widths:
<img
src="photo-800.jpg"
srcset="photo-800.jpg 800w, photo-1600.jpg 1600w"
sizes="(max-width: 800px) 100vw, 800px"
width="800" height="533"
alt="Describe the photo">The w values must match the real pixel widths of the files. Image Processor with Resize to Fit sets the width exactly only when the source is wider than tall. For mixed orientations, verify the results.
Verify a batch before publishing
A batch can produce hundreds of wrong files quickly. Always test small.
- Copy five varied files into a test folder: landscape, portrait, small, transparent, and CMYK if you have one.
- Run the batch on that folder only.
- Check dimensions, file size, color, and transparency in the results.
- Open the error log if you created one.
- Run the full batch only after the test passes.
Quick reference of common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| All images the same width, portraits stretched | Action uses fixed width and height | Use Resize to Fit or split by orientation |
| Dialog appears on every file | Dialog toggle is on in the action | Turn off the dialog icon on that step |
| Files saved twice | Action contains a save step and Image Processor also saves | Remove the save from the action |
| White background where transparency was | JPEG output | Use an action that exports PNG |
| Colors look dull in a browser | No sRGB conversion | Tick Convert Profile to sRGB |
| Batch stops partway | Missing layer or an open prompt | Log errors to file and suppress prompts |
Exercise
You have 200 product photos of mixed orientation, with a longest side of 5000 px. You need JPEGs that fit inside 1600 by 1600 px, in sRGB, saved to a separate folder, without touching the originals. Which tool do you use, and which settings?
Show answer
Use File > Scripts > Image Processor. Select the source folder, choose a different destination folder, tick Save as JPEG with a quality such as 8, tick Resize to Fit with W 1600 and H 1600 (this keeps the aspect ratio, so portraits and landscapes both fit), and tick Convert Profile to sRGB. Test on a few files first.
Exercise
You need transparent PNG logos at 512 px wide from a folder of PSD files. Why can't Image Processor do this alone, and what do you do instead?
Show answer
Image Processor writes only JPEG, PSD, or TIFF, so it cannot produce PNG. Record an action that resizes to 512 px wide and exports as PNG, then run it over the folder with File > Automate > Batch (or a droplet), after testing a few files.