Turn flat astro images into stereo pairs, wiggle animations, red/cyan anaglyphs, interactive HTML 3D, pseudo-surface point clouds, and top-down galaxy views — all from a single sub.
Pick one from the top Output dropdown:
| Mode | What it does | How to view |
|---|---|---|
| Stereo (Parallel) L | R | Side-by-side left-eye-left, right-eye-right. Image is reasonably sized to free-fuse. | Diverge your eyes slightly (as if staring past the screen) until the two images fuse into one 3D image. |
| Stereo (Cross-eye) R | L | Side-by-side right-eye-left, left-eye-right. Same source, swapped output. | Cross your eyes (as if looking at your nose) to fuse. Easier for most people than parallel. |
| Wiggle stereo | Rapidly alternates L and R views at the Wiggle period you set. | Just watch — your visual system interprets the motion as depth. No glasses, no eye-crossing. Share as GIF or MP4. |
| Anaglyph (Red/Cyan) | Classic 3D-glasses composite — red channel is left-eye luminance, cyan is right-eye luminance. | Red/cyan paper glasses. Looks washed out without them, pops into 3D with. |
| Interactive 3D (HTML) | Exports a Plotly-based 3D sphere (or point cloud) you can rotate, zoom and pan in any browser. | Opens in your default browser. Standalone HTML, works offline, shareable. |
| Galaxy Polar View (Top-Down) | Takes an inclined galaxy and reprojects it as if viewed face-on from the galactic north pole. | Just view normally. The deprojected image lives at native resolution for stacking into comparisons. |
The three stereo modes (Parallel, Cross-eye, Wiggle) and the Anaglyph all share the same underlying stereo-pair generation — they just differ in how the pair is composited for display. Interactive 3D and Galaxy Polar View generate their outputs via different pipelines.
| Type | When to use |
|---|---|
| Normal (Sphere only) | Any planet, moon, or round body where you want the body treated as a sphere. Mars, Venus, Jupiter without rings, Mercury, moons. |
| Saturn (Sphere + Rings) | Saturn — adds an elliptical annulus for the rings with front/back occlusion by the planet body. |
| Pseudo surface (Height from brightness) | Lunar craters, solar granulation, or any surface where image brightness correlates with 3D height. Also works beautifully on nebulae for an artistic "cosmic landscape" effect. |
| Galaxy (Disk deprojection) | Edge-on or inclined galaxies where you want to see the disk structure from above. Also exposes PA / tilt controls that let the Interactive 3D export produce a proper tilted galaxy mesh. |
The planet type and the output mode combine freely: for example, "Saturn + Interactive 3D" gives you a Plotly sphere with real ring geometry you can orbit, while "Pseudo surface + Wiggle" gives you a swaying heightmap of your lunar close-up.
When "Review / adjust detected disk" is enabled, Generate pauses to let you confirm the disk location. The dialog shows the image with a green circle (and, for Saturn / galaxy / planet types, an ellipse overlay with PA and tilt handles).
The background behind the planet can be configured three ways:
The Background depth slider controls how much the background participates in the stereo parallax, as a percentage of the planet's parallax:
The HTML export has three distinct forms depending on planet type:
The projection math, the ring geometry, the pseudo-surface heightmap, the galaxy deprojection, and the anaglyph composition.
The planet in your image is a 2D disk — the orthographic shadow of a sphere. To make stereo, we first unproject each disk pixel back onto the sphere, then rotate the sphere by ±θ around the vertical axis, then project back to pixels for the left and right views.
Setup: center coordinates at the disk center, scale so x and y lie in [-1, 1] at the limb (so r = 1 is the disk radius). The front-hemisphere height is:
Rotate the sphere around the vertical (Y) axis by angle θ (positive for left eye, negative for right):
Project back to pixel coordinates:
where (cx, cy) is the disk center in the image and r is the disk radius in pixels. The result is implemented as cv2.remap with Lanczos4 interpolation; pixels outside the disk get borderValue=0. This correctly curves the sphere so that limb features move more than central features — the natural stereo effect of looking at a 3D ball from two angles.
Rings are modeled as a tilted elliptical annulus in the image plane. For a position (x, y) relative to the disk center, rotate into the ring's own frame by -PA to get (xr, yr). The outer ellipse condition is:
with ao = (outer factor) · r and bo = ao · tilt. The inner ellipse is the same with ai, bi. The ring annulus is:
The tilt parameter (b/a) encodes the viewing inclination of the ring plane:
so tilt = 1 is face-on (circle) and tilt → 0 is edge-on. For true 3D geometry in the Interactive HTML export, this is inverted:
to recover the actual ring-plane inclination from the apparent axis ratio in your image.
The ring plane crosses the planet body: part of the ring sits in front of the body (closer to you), part sits behind. To composite them correctly, we split the ring annulus into two halves using the signed distance along the minor-axis normal:
where (nx, ny) = (cos(PA + 90°), sin(PA + 90°)) is the unit vector along the ring plane's minor axis in the image. During compositing, back-half ring pixels are drawn first (so the planet body overpaints them), then the planet body is drawn, then front-half ring pixels (so they sit on top of the body). This creates the familiar "ring passing in front of Saturn" visual effect.
Rings are flat 2D structures — the sphere-reprojection math from §8.1 doesn't apply. Instead, we use a simpler yaw warp for stereo disparity on the ring pixels:
which horizontally foreshortens the ring positions around the rotation center. This produces parallax that scales with distance from the center (so ring tips move more than ring bases), matching how a rotating ring plane would appear to shift between two eye positions.
For the Pseudo surface planet type, image brightness is treated as 3D height. The pipeline, in order:
1. Compute luminance as the Rec.709 weighted sum: Y = 0.299·R + 0.587·G + 0.114·B.
2. Center around the median so background is near zero height:
3. Apply gamma shaping (preserving sign) to control contrast:
Default γ = 1.15 emphasizes bright peaks slightly; γ < 1 broadens depth; γ > 1 sharpens it.
4. Normalize by MAD (Median Absolute Deviation) so bright stars don't dominate:
The gain divisor 6 gives a visually comfortable amplitude without stars exploding into huge disparity spikes. The result is clipped to [-1, 1].
5. Compute per-pixel disparity from the stereo strength θ:
and clamp Δmax to at most 0.35 · min(H, W) so disparity never gets absurd on large frames.
6. Warp each pixel horizontally by ±½Δ for the left/right views:
Bilinear remap (INTER_LINEAR, deliberately not Lanczos) because Lanczos ringing on sharp stars would produce visible halos in the output.
The red/cyan anaglyph composite uses luminance from each eye to drive one color channel:
Luminance (rather than per-color-channel copying) is used because it's more robust across different source color balances — a stereo pair derived from a monochrome luminance capture produces the same anaglyph as one from a well-balanced RGB. The red lens of the glasses blocks the cyan (G+B) channels, delivering only the left-eye luminance to the left eye; the cyan lens blocks red, delivering only the right-eye luminance to the right eye. Your visual system fuses the two monochrome views into depth.
The Galaxy Polar View reverses the perspective-and-tilt projection that turned the real face-on galactic disk into the elliptical patch you see in your image. Given an output grid (u, v) ∈ [-1, 1] in the deprojected disk plane:
1. Apply the inclination foreshortening (y compressed by the tilt factor):
2. Rotate by the galaxy's position angle α (negative, to undo the on-sky rotation):
3. Scale by the galaxy's apparent radius r in pixels and translate back to image coordinates:
where X and Y are the rotated-and-tilted plane coordinates. The output image is sampled by cv2.remap at these back-projected coordinates. Pixels where (u, v) falls outside the galaxy's apparent ellipse remain black.
The result: a galaxy that looked like a thin needle (edge-on) can be shown as a face-on disk, revealing spiral structure that was foreshortened out of visibility in the original frame. This is purely a geometric reprojection — it doesn't invent any new information, so features that were hidden behind the disk from your line of sight stay hidden. But features that were just squashed by projection recover their original on-disk shape.
For the Plotly sphere export, the planet disk is first converted to an equirectangular (latitude/longitude) texture that can be mapped onto a sphere mesh. For each (lat φ, lon λ) in the texture:
Orthographically project onto the disk:
and sample the disk pixel at (u, v). Points on the back hemisphere (Z < 0) stay black because you have no information about what's behind. The resulting equirectangular image is then wrapped onto a Plotly Mesh3d sphere, giving you a rotatable 3D planet where the near-side pixels are your real data and the far side is dark.
The disk-detection pipeline (used both for automatic ROI centering and in the Auto-detect button of the adjust dialog):
cv2.fitEllipse, recovering the major/minor axes, orientation angle, and refined center all in one step. The ellipse PA and the b/a tilt both come out of this fit directly.This matches the WinJUPOS approach of fitting a limb ellipse rather than assuming a perfect circle — valuable for Jupiter and Saturn, which are visibly oblate, and essential for galaxies, which are inclined.
The background depth setting determines how much the background participates in stereo:
where pdepth is the depth percentage from the slider (0 to 1 for 0% to 100%). The background is then shifted by ±½Δbg for the left/right views. At pdepth = 0 the shift is zero and both views see the same background — the stars appear "screen locked". At pdepth = 1 the background shifts the same as the planet — stars appear "at planet depth". The 25% default puts stars visually further than the planet, which is the natural astronomical ordering.
cv2.remap, cv2.fitEllipse, cv2.connectedComponentsWithStats) for warping and segmentation; Otsu's method (Otsu 1979) for automatic thresholding; the orthographic sphere-to-disk projection is standard computer graphics; the red/cyan luminance anaglyph convention follows mainstream 3D-glasses practice; Plotly for the interactive 3D exports (via CDN); the equirectangular texture mapping is the standard spherical-image convention used across every 3D rendering engine.