The VR180 Lens Masks included in this zip file were generated using Claude AI. The following is a prompt that users can use in a Claude chat to generate similar graphics. By modifying this prompt, users may be able to make adjustments and generate new mask graphics.

-----

Prompt:

Please generate a set of VR180 lens-mask overlay images for Canon dual-fisheye footage (RF 5.2mm F2.8 L Dual Fisheye). Use code execution: save the Python script below exactly as written, install numpy and Pillow if needed, run it, and give me the 9 PNG files it creates. Do not change the script or its numbers; they have already been tuned and tested in a VR headset.

What the masks are for: Canon's EOS VR Utility and EOS VR Plug-in have a "Lens Mask" option that hides the neighbouring lens visible at the edge of each eye. These PNGs replace that option. Export with Canon's Lens Mask turned OFF, put one PNG on a track above the footage (Normal blend, 100% opacity, no scaling or repositioning), and the mask is applied in your editor instead.

Format: 8192x4096 side-by-side equirectangular VR180 (left eye on the left), transparent PNG, black where masked. Each file has:
- four lens cut-outs, one on each vertical edge of each eye, centred on the horizon
- a rounded black vignette around each eye
- 3 degrees of floating-window parallax, so both eyes fuse the mask as a frame in front of the scene instead of seeing doubled edges

The 9 files are every combination of:
- edge: soft_edge (about 18 px blur), medium_edge (about 10 px), hard_edge (no blur)
- vignette: regular (no suffix, 88.5 deg), _minimal_vignette (89.9 deg, a hairline at every edge), _wide_vignette (82.4 deg, just big enough to swallow the cut-outs)

After running it, show me one of the masks composited over a mid-grey background so I can see the shape, then send me all 9 PNGs. If my footage is a different 2:1 size, run it with --width set to my frame width (for example --width 7680).

```python
#!/usr/bin/env python3
"""VR180 lens mask for Canon dual-fisheye footage (RF 5.2mm), side-by-side
equirectangular, left eye on the left. Transparent PNG, black where masked.
Composite over footage converted with Canon's own "Lens Mask" option OFF.

  - Four lens cut-outs: a circular segment on each vertical edge of each eye,
    centred on the horizon (circle radius 0.222 x eye height, 0.042 deep),
    matched to the cut-outs Canon's EOS VR Utility draws.
  - Rounded vignette: blacks out everything farther than BORDER degrees from
    each eye's optical axis.
  - 3 deg floating-window parallax: the left eye's left-side mask and the right
    eye's right-side mask are pushed in by 3 deg, so the mask reads as a frame
    in front of the scene and both eyes fuse it.
  - Edge softening: Gaussian blur, faded in from a black frame edge.
"""
import argparse
import numpy as np
from PIL import Image, ImageFilter

RADIUS, DEPTH = 0.222, 0.042


def cutouts(S, depth_left, depth_right):
    yy, xx = np.mgrid[0:S, 0:S].astype(np.float32) + 0.5
    r, cy = RADIUS * S, 0.5 * S
    left_cx = (depth_left - RADIUS) * S
    right_cx = S - (depth_right - RADIUS) * S
    return (((xx - left_cx) ** 2 + (yy - cy) ** 2 < r * r) |
            ((xx - right_cx) ** 2 + (yy - cy) ** 2 < r * r))


def border(S, deg):
    u = (np.arange(S, dtype=np.float32) + 0.5) / S
    az, el = np.meshgrid(np.deg2rad(u * 180 - 90), np.deg2rad(90 - u * 180))
    return np.cos(az) * np.cos(el) < np.cos(np.deg2rad(deg))


def shifted(m, s):
    """Mask unioned with itself shifted s px (positive = right)."""
    out = m.copy()
    if s > 0:
        out[:, s:] |= m[:, :-s]; out[:, :s] = True
    elif s < 0:
        out[:, :s] |= m[:, -s:]; out[:, s:] = True
    return out


def make_mask(width, height, border_deg, feather, parallax):
    S = height
    p = parallax / 180.0
    s = int(round(p * S))
    left = cutouts(S, DEPTH + p, DEPTH)        # left eye: deeper on its left
    right = cutouts(S, DEPTH, DEPTH + p)       # right eye: deeper on its right
    if border_deg > 0:
        b = border(S, border_deg)
        left |= shifted(b, s)
        right |= shifted(b, -s)
    tiles = []
    for t in (left, right):
        t = np.where(t, 255, 0).astype(np.uint8)
        if feather > 0:
            sig = feather * S
            pad = int(np.ceil(4 * sig))
            t = np.pad(t, pad, constant_values=255)
            t = np.asarray(Image.fromarray(t, 'L').filter(ImageFilter.GaussianBlur(sig)))[pad:-pad, pad:-pad]
        tiles.append(t)
    out = Image.new('RGBA', (width, height), (0, 0, 0, 0))
    out.putalpha(Image.fromarray(np.concatenate(tiles, axis=1), 'L'))
    return out


EDGES = {'soft_edge': 0.00133, 'medium_edge': 0.000667, 'hard_edge': 0.0}
VIGNETTES = {'': 88.5, '_minimal_vignette': 89.9, '_wide_vignette': 82.4}

if __name__ == '__main__':
    ap = argparse.ArgumentParser()
    ap.add_argument('--outdir', default='.')
    ap.add_argument('--width', type=int, default=8192)
    ap.add_argument('--parallax', type=float, default=3.0)
    a = ap.parse_args()
    W, H = a.width, a.width // 2
    for ename, f in EDGES.items():
        for vname, deg in VIGNETTES.items():
            name = f'{a.outdir}/vr180_lens_mask_{W}x{H}_p3_{ename}{vname}.png'
            make_mask(W, H, deg, f, a.parallax).save(name)
            print('wrote', name)
```
