Convert equirectangular panorama images into cubemap images. Written in Go.
Inspired by denivip/panorama.
Image source: Timothy Oldfield on Unsplash
- Supports JPEG and PNG input/output
- Three interpolation algorithms: nearest, bilinear (default), bicubic
- Selective face extraction (front, back, left, right, top, bottom)
- Batch directory processing with concurrent execution
- Configurable output quality and cube face size
panorama [flags]
Flags:
-i, --in string input image file path (required if --indir is not specified)
-d, --indir string input directory path (required if --in is not specified)
-o, --out string output file directory path (default ".")
-l, --len int edge length of a cube face (default 1024)
-s, --sides strings list of sides: front,back,left,right,top,bottom (default: all)
-q, --quality int jpeg output quality, 1-100 (default 75)
-p, --interpolation string interpolation method: nearest, bilinear, bicubic (default "bilinear")
-h, --help help for panorama# Basic conversion
./panorama -i ./sample.jpg -o ./dist
# High quality bicubic with 2048px faces
./panorama -i ./sample.jpg -o ./dist -l 2048 -p bicubic -q 95
# Only front and back faces
./panorama -i ./sample.jpg -o ./dist -s front,back
# Batch process a directory
./panorama -d ./input_dir -o ./distgit clone https://github.com/blackironj/panorama.git
cd panorama
go build -o panoramaPre-built binaries are available on the Releases page.
Supported platforms: Linux (amd64/arm64), macOS (amd64/arm64), Windows (amd64).
| Method | Speed | Quality | Description |
|---|---|---|---|
nearest |
Fastest | Low | Nearest pixel sampling, good for previews |
bilinear |
Balanced | Medium | 4-pixel weighted average (default) |
bicubic |
Slowest | High | 16-pixel Catmull-Rom kernel, sharpest output |
