This diff makes it open bigger (and slower 🙂) and it opens pointing at the center of the equirectangular image, which is conventionally the yaw and pitch origin (i.e. both 0°) if the initial view yaw / pitch / roll XMP tags aren't set in the image's metadata:
--- script.py.ORIG 2026-08-15 22:34:05.783171363 +0300
+++ script.py 2026-08-15 22:30:57.004051522 +0300
@@ -1,3 +1,5 @@
+#!/usr/bin/env python3
+
# /// script
# dependencies = [
# "numpy",
@@ -142,7 +144,7 @@
def viewer(image: Image.Image, size: tuple[int, int]):
- yaw = 0
+ yaw = np.pi
pitch = 0
roll = 0
viewport_dist = 0.5
@@ -228,7 +230,7 @@
pygame.quit()
-def load_image(file_path: Path, target_width: int = 500) -> Image.Image:
+def load_image(file_path: Path, target_width: int = 2560) -> Image.Image:
img_full_res = Image.open(file_path)
width, height = img_full_res.size
@@ -253,7 +255,7 @@
viewer(
image = load_image(file_path),
- size = (300, 200),
+ size = (1280, 720),
)
For reference, the aforementioned XMP tags that good panorama players should consider to set the initial viewpoint (but few actually do 🙂) are:
GPano:PoseHeadingDegrees
GPano:PosePitchDegrees
GPano:PoseRollDegrees
GPano:InitialViewHeadingDegrees
GPano:InitialViewPitchDegrees
GPano:InitialViewRollDegrees
My understanding is that they are redundant, and so few viewers actually use them that I always set them to 0° in all my images and physically reframe the picture so the initial viewpoint is at the center of the equirectangular image and the pitch 0°, as a lowest common denominator, so it's viewed correctly with most viewers. And in my own repo of 360° material, I set the pitch separately in the HTML file.