Perplexity helped me find a solution that makes Joost's suggestion much easier to do. His recommendation:
Take your 360 image and extend it at at the left and right hand side by copying a part from the opposite side. So you then wider image with some parts repeated at both ends.
Doing this with an image editor like Affinity Photo takes a lot of time, especially with my 50k px by 25k px equirects.
Perplexity recommended using Imagik to expand and later crop the image back to the original size.
Here are the instructions if anyone wants to use this technique on a Mac.
1. Install Homebrew (if you don’t have it)
Follow the prompts. When it finishes, you should be able to run:
brew --version
If that prints a version, Homebrew is installed.
2. Install ImageMagick via Homebrew
In the same Terminal window:
brew install imagemagick
This pulls a current, precompiled build with JPEG, PNG, TIFF, etc.
Verify that it’s working:
magick -version
You should see version info and a list of supported formats including JPEG.
Now to the scripts to expand and later crop the image(s) by 500px at each end. Note that these scripts are written solely for processing jpeg equirects with the extent: .jpg. The jpeg quality is 95. All jpeg's in the target folder will be expanded into a subfolder named Out.
1. Create the expand script in ~/bin. (If the /bin folder doesn't exit, ask AI how to create it.)
Open the nano editor in Terminal:
nano ~/bin/expand_panos.sh
Paste this:
#!/bin/zsh
mkdir -p out
for f in *.jpg; do
[ -e "$f" ] || continue
base="${f%.*}"
noglob magick "$f" -crop 500x%[h]+%[fx:w-500]+0 +repage "${base}_right.png"
noglob magick "$f" -crop 500x%[h]+0+0 +repage "${base}_left.png"
noglob magick "${base}_right.png" "$f" "${base}_left.png" +append -quality 95 "out/${base}_expanded_q95.jpg"
rm -f "${base}_right.png" "${base}_left.png"
done
Save and exit (Ctrl‑O, Return, Ctrl‑X), then make it executable:
chmod +x ~/bin/expand_panos.sh
2. Create the crop‑back script in ~/bin
nano ~/bin/crop_panos.sh
Paste:
#!/bin/zsh
mkdir -p out_cropped
for f in out/*_expanded_q95.jpg; do
[ -e "$f" ] || continue
base="${f##*/}"
base="${base%_expanded_q95.jpg}"
noglob magick "$f" -gravity center -crop '%[fx:w-1000]x%[h]+0+0' +repage "out_cropped/${base}_cropped.jpg"
done
Save and exit, then:
chmod +x ~/bin/crop_panos.sh
3. Run them from your pano folder
First, ensure ~/bin is on your PATH once (only if this fails):
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
4. Output the equirect(s) from PTGui to a dedicated target folder, like panos. Open Terminal there, which is most easily done in Finder by:
- Open a new Finder window.
- Navigate to the target folder.
- Ensure that in the Finder View menu you have enabled "Show Path Bar", which displays the entire path below the folder listing.
(mine: '/Users/(my username)/Documents/Projects/Panos') - Right-click on the target folder (Panos) and select "Open in Terminal".
To see and verify the contents of the Panos folder in Terminal type:
ls
(That's lowercase LS)
To expand all the jpeg files in Panos by 1000 px (500 on each side) run this command in Terminal.
expand_panos.sh # builds the out/ folder with expanded panos
5. Do whatever you want to the jpeg image in your photo editor. Do not resize it though! The resulting output file needs to end up in the same /Out folder from which it came. Since "Saving" a file in Affinity Photo saves it as a special .afphoto file, which means it contains the original expanded equirect from PTGui along with all the changes (I use adjustment layers for all changes), I export the result to a jpeg to the /out folder and let it overwrite the original.
6. In Terminal, still open to the panos folder, crop off the extended parts of the image:
crop_panos.sh # builds out_cropped/ with 2:1 crops from out/
The cropped, ready-to-view result will be in the /out_cropped subfolder of Panos.
So far this approach has worked for me every time. I avoid painting masks near the left and right edge of the image, but otherwise I am free to use any tool for color grading all or any part of the image. I use Adjustment and Live Filter layers so all changes are non-destructive. The presence of the extended sections prevents a seam from appearing after it is cropped back to the 2:1 ratio for viewing in PTGui Viewer and further use.
On Friday, March 27, 2026 at 1:02:04 AM UTC-5 PTGui Support wrote: