Photoshop Actions Based on Image Orientation
Adobe Photoshop allows users to streamline batch processing by using conditional actions that execute specific tasks based on an image's orientation. By evaluating whether an image is horizontal, vertical, or square, Photoshop can dynamically apply different editing steps—such as resizing, cropping, or watermarking—without requiring manual sorting. This article explains how conditional logic identifies document dimensions and directs processing steps accordingly.
The Underlying Logic of Document Orientation
Photoshop evaluates orientation by comparing the document's pixel dimensions:
- Document is horizontal: The pixel width is greater than the pixel height (Landscape).
- Document is vertical: The pixel height is greater than the pixel width (Portrait).
- Document is square: The width and height pixel values are exactly equal.
When a conditional command is triggered, Photoshop checks these active document properties and executes a designated sub-action if the condition is met, or an alternate sub-action if it is not.
Setting Up Orientation-Based Conditional Actions
To set up an orientation-dependent workflow, you must prepare individual actions for each scenario before linking them with a conditional command.
- Record the Target Actions:
- Create and record an action containing the steps specifically meant for landscape images (e.g., "Resize Landscape").
- Create and record a separate action containing the steps for portrait images (e.g., "Resize Portrait").
- If necessary, record an action for square images.
- Create the Master Controller Action:
- In the Actions panel, click the Create New Action button and name it (e.g., "Orientation Master Controller").
- Insert the Conditional Step:
- Open the flyout menu in the top-right corner of the Actions panel.
- Select Insert Conditional... to open the conditional logic dialog box.
- Define the Conditions:
- In the If Current dropdown, select the dimension
criterion (e.g.,
Document is horizontal). - In the Then Play Action dropdown, select the action to run when the condition is true (e.g., "Resize Landscape").
- In the Else Play Action dropdown, select the fallback action to run if the condition is false (e.g., "Resize Portrait").
- Click OK to commit the step.
- In the If Current dropdown, select the dimension
criterion (e.g.,
Handling Square Formats
Because standard conditional logic uses an "If/Then/Else" binary decision, handling three possibilities (landscape, portrait, and square) requires nesting conditions:
- Set the first condition to check:
If Current: Document is square. - Set Then Play Action to your square-specific action.
- Set Else Play Action to a secondary conditional
action that checks:
If Current: Document is horizontal, which then routes to landscape or portrait actions accordingly.
When running automated tasks via File > Automate > Batch or the Image Processor, selecting the master controller action ensures that every file is routed through the correct processing sequence based on its orientation.