Batch apply drop shadow effects to product/SKU images via Photoshop MCP. Auto-apply when the user asks to add shadows to multiple images, batch process product photos, apply layer effects to SKU images, or automate Photoshop layer styles across files. Requires the Photoshop MCP proxy to be running on port 3001 with the UXP plugin connected.
Apply consistent drop shadow effects to batches of product images via the Photoshop MCP proxy.
Before running, verify:
lsof -i :3001~/.00bx-photoshop-mcp/mcp/.venv/If not set up, see photoshop-mcp-setup/README.md for installation instructions.
The batch script connects to Photoshop via a WebSocket proxy and for each image:
These settings were extracted from the reference file Abalone Yu Sheng (shadow).psd:
| Setting | Value |
|---|
| Blend Mode | Normal |
| Color | Near-black (RGB ~0.8, 1.1, 1.1) |
| Opacity | 80% |
| Angle | 130° (not global light) |
| Distance | 150px |
| Spread | 0px |
| Size (blur) | 50px |
| Noise | 3% |
| Contour | Linear |
| Layer Effects Scale | 400% |
<working-dir>/
├── input/ ← source images (any subfolder structure)
├── output-psd/ ← PSD outputs
├── output-png/ ← PNG outputs
└── batch_shadow.py ← the batch script
~/.00bx-photoshop-mcp/mcp/.venv/bin/python batch_shadow.py
To change shadow settings, modify the DROP_SHADOW_SETTINGS dict in batch_shadow.py.
To change the canvas expansion (default +1000px each side), modify the resizeCanvas call width/height values in process_image().
To change input/output paths, modify INPUT_DIR, OUTPUT_PSD, OUTPUT_PNG at the top of the script.
The proxy accepts socket.io connections on ws://localhost:3001. Commands use this format:
command = {
"application": "photoshop",
"action": "<action_name>",
"options": { ... }
}
| Action | Options | Description |
|---|---|---|
openFile | filePath | Open an image |
getLayers | (none) | List all layers |
executeBatchPlayCommand | commands, layerId | Run raw batchPlay |
resizeCanvas | width, height, anchor | Resize canvas (absolute px) |
saveDocumentAs | filePath, fileType | Save as PSD/PNG/JPG |
getDocuments | (none) | List open documents |
commands = [{
"_obj": "set",
"_target": [
{"_ref": "property", "_property": "layerEffects"},
{"_ref": "layer", "_id": layer_id}
],
"to": {
"_obj": "layerEffects",
"scale": {"_unit": "percentUnit", "_value": 400},
"dropShadow": { ... }
}
}]
send_command("executeBatchPlayCommand", {"commands": commands, "layerId": layer_id})
To extract shadow settings from an existing PSD:
commands = [{
"_obj": "get",
"_target": [
{"_property": "layerEffects"},
{"_ref": "layer", "_id": layer_id}
]
}]
result = send_command("executeBatchPlayCommand", {"commands": commands})
# result["response"][0]["layerEffects"]["dropShadow"] contains all settings
resizeCanvas action (built-in) instead of batchPlay canvasSize