Donncha<p><strong>Export photos with a border from Lightroom Classic</strong></p><p>This is how I add a nice thick black border to my photos after I export them from Lightroom Classic using free software.</p> <p>This is for macOS, but since the same software exists on Windows, you can do something similar there, but I haven’t used that platform in years, so YMMV.</p><p>I’m going to presume you’re familiar with <a href="https://helpx.adobe.com/ie/lightroom-classic/help/export-presets-settings-plug-ins.html" rel="nofollow noopener" target="_blank">export presets</a> in Lightroom Classic. You’re going to use one of them to run a small script that does the <em>magick</em>.</p><p>Take a deep breath. You’re going to learn a lot in the next couple of steps. Persist, and it will be worth it.</p><p><strong>Installing ImageMagick</strong></p><p>To add the border you need to install <a href="https://formulae.brew.sh/formula/imagemagick" rel="nofollow noopener" target="_blank">ImageMagick</a> using <a href="https://brew.sh/" rel="nofollow noopener" target="_blank">brew</a>. Think of ImageMagick as a Swiss Army knife for images. While Lightroom excels at organizing and editing individual photos, ImageMagick can automatically resize hundreds of images, create contact sheets, add watermarks, or convert file formats. You can do all this without you having to click through each image individually.</p><p><strong>Step 1: Open Terminal (It’s Not as Scary as It Sounds!)</strong></p><p>Terminal is like a text-based way to talk to your Mac. Instead of clicking buttons, you type commands. Here’s how to find it:</p><ol><li>Press <code>Command + Space</code> to open Spotlight search</li><li>Type “Terminal” and press Enter</li><li>A black window will open. This is Terminal</li></ol><p>Don’t panic if it looks intimidating! Think of it like switching from Auto mode to Manual on your camera. It gives you more control once you know what you’re doing.</p><p><strong>Step 2: Install Homebrew (Your New Best Friend)</strong></p><p>Homebrew is like an App Store for command-line tools. It makes installing software like ImageMagick incredibly easy. Here’s how to install it:</p><ol><li>Copy this entire command (click and drag to select it all):<br><code>/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"</code></li><li>Paste it into Terminal (Command + V) and press Enter.</li><li>You’ll be prompted to enter your Mac’s password (the same one you use to log in). <strong>Note:</strong> When you type your password, you won’t see any characters appear. This is normal for security reasons. Just type it and press Enter.</li><li>The installation will take a few minutes. You’ll see lots of text scrolling by, and this is normal! Grab a coffee and let it do its thing.</li><li>When it’s finished, you might see instructions about adding Homebrew to your PATH. If you see a message starting with “Run these two commands in your terminal,” copy and paste those commands one at a time.</li></ol><p><strong>Step 3: Install ImageMagick</strong></p><p>Now that you have Homebrew installed, installing ImageMagick is incredibly simple:</p><ol><li>Type this command in Terminal:<br><code>brew install imagemagick</code></li><li>Press Enter and wait.</li><li>This will download and install ImageMagick automatically. When it’s done, you’ll see your command prompt again (it looks like <code>YourName@YourMac ~ %</code> or similar).</li></ol><p><strong>Step 4: Test Your Installation</strong></p><p>Let’s make sure everything worked:</p><ol><li>Type this command:<br><code>magick -version</code></li><li>If you see version information appear (something like “Version: ImageMagick 7.1.x”), congratulations! You’ve successfully installed ImageMagick.</li></ol><p>Apart from adding borders to images, ImageMagick can also resize images, convert RAW files to Jpeg, add watermarks and more.</p><p><strong>Your first ImageMagick script</strong></p><p>Open TextEdit or your favourite text editor to create your black borders script. If you use TextEdit, you need to adjust the settings as follows.</p><p>Go to TextEdit → Preferences and under “New Document”</p><ol><li>Select “Plain text”.</li><li>Uncheck “Smart quotes” and “Smart dashes”.</li></ol><p>Copy this code into your editor before saving it in your Documents folder as add_black_borders.sh</p> <pre>#!/bin/bash# Add black borders to export imagestoday=$(date +%F)open ~/Pictures/for file in "$@"do echo "Working on $file" > ~/export.log /opt/homebrew/bin/magick "$file" -bordercolor black -border 15 /tmp/out.jpg >> ~/export.log 2>> ~/err.log mv /tmp/out.jpg "$file" rm "$file"_originaldone</pre> <p>Your computer can’t run the script without making it executable, so use this command to do that:</p> <pre>chmod +x ~/Documents/add_black_borders.sh</pre> <p><strong>Add it to Lightroom Classic</strong></p><p>Lightroom Classic has an “after export” setting in the export dialog you can use to modify the photo(s) you just exported. You’re going to write a small computer programme called a “shell script” that uses ImageMagick to add the border.</p><p>Right click on an image, go to <code>Export</code> and click on <code>Export....</code>. Select your export preset and scroll to the bottom, to “Post-Processing. It will look something like this. Click on the “After Export” setting and then on “Go to Export Actions Folder Now”.</p><p>A new Finder window will open there. It should be <code>Library/Application Support/Adobe/Lightroom/Export Actions/</code> in your home directory.</p> <p>Copy the script from your Documents folder to the Export Actions folder by dragging it from one folder to the other.</p><p><strong>Export with Borders</strong></p><p>Go to your desired export action in the <code>Export...</code> menu in Lightroom Classic. Scroll to the end, and the <code>After Export</code> setting will have your <code>add_black_borders</code> script. </p> <p>Select that, and remember to update the settings for your export preset.</p> <p>Export an image, and it should have a black border. The Pictures folder will pop up too, but you can change that in the script in the line that says <code>open ~/Pictures/</code>. Change that to wherever you put your exported images.</p><p><strong>Customize the output</strong></p><p>You can change the border width and colour in the script. Look at the <code>magick</code> line.</p><ol><li>It’s 15 pixels by default.</li><li><code>-bordercolor black</code> can be changed to <a href="https://imagemagick.org/script/color.php#color_names" rel="nofollow noopener" target="_blank">whatever colour you want from this list</a>.</li></ol><p>Search online, and you’ll find other commands to further change how the border looks.</p><p><strong>Bonus: split panoramas</strong></p><p>Here’s a bonus script. Save it as panorama.sh in the <code>Export Actions</code> folder. Add it to an export action you use for horizontal panoramas. Vertical panoramas can be split using <code>100%x33.33%</code> instead.</p> <pre>#!/bin/bashopen ~/Pictures/for file in "$@"; do base=$(basename "$file" .jpg) out=$(dirname "$file") /opt/homebrew/bin/magick "$file" -crop 33.33%x100% "${out}/${base}_split_%d.jpg"done</pre> <p><strong>Gobbledygook?</strong></p><p>I hope that made some sense, and it works for you. It is unfortunately technical, but take things slowly and carefully, and you’ll have beautiful borders on your exported photos!</p><p></p>Apertureƒ/8CameraILCE-7RM5Focal length172mmISO100Shutter speed5s<p><a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://inphotos.org/tag/imagemagick/" target="_blank">#imagemagick</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://inphotos.org/tag/words/" target="_blank">#Words</a></p>