MacOS Quick Action that adds a random gradient background + drop shadow to images

MacOS Quick Action that adds a random gradient background + drop shadow to images

22-03-2026

MacOS Quick Action that adds a random gradient background + drop shadow to images. Supports batch processing — just select multiple files in Finder, right-click, and go. Requires ImageMagick.

A macOS Quick Action script that adds a random gradient background + drop shadow to any image (or batch of images) directly from Finder's right-click menu. Powered by ImageMagick.


What it does


Requirements


Step 1 — Install ImageMagick

Open Terminal and run:

brew install imagemagick

Verify it's working:

magick --version

Step 2 — Create the Quick Action in Automator

  1. Open Automator (use Spotlight: ⌘ Space → type Automator)
  2. Click New Document
  3. Choose Quick Action as the document type
  4. At the top of the workflow, set:
  1. In the search bar on the left, search for Run Shell Script
  2. Drag it into the workflow area on the right
  3. In the action settings:
  1. Paste the script above into the text area

Step 3 — Save the Quick Action

  1. Press ⌘ S to save
  2. Name it: Add Gradient Background
  3. Close Automator

Step 4 — Use it in Finder

  1. Select one or more image files in Finder
  2. Right-click → Quick Actions → Add Gradient Background
  3. Done! A new file named yourimage_gradient.jpg will appear in the same folder

Batch processing works out of the box — select as many images as you want, they'll each get their own unique random gradient.


Customization

You can tweak these four variables inside the script:

| Variable | Default | What it controls |

| PADDING | 80 | Border size around the image (px) |

| SHADOW_OFFSET | 12 | How far the shadow is offset (px) |

| SHADOW_BLUR | 18 | Shadow softness / spread |

| SHADOW_OPACITY | 70 | Shadow darkness (0 = none, 100 = solid black) |

| MAX_BRIGHTNESS | 200 | Max brightness to allow for gradient colors (lower = darker colors only) |


Troubleshooting

Quick Action doesn't appear in Finder

magick: command not found

Test it in Terminal first

zsh /path/to/add_gradient_background.sh /path/to/image.jpg

This shows the exact error if something goes wrong.


Output example

✅ Saved: /Users/you/Desktop/photo_gradient.jpg
   Gradient: #3A1F8C → #C04A22 | Angle: 135° | Shadow: offset=12px blur=18px