Fun Gravitational Lensing Demo

Here you can see how an image gets distorted by a single (very simple) gravitational lens.

Step 1 — Pick an image: paste from clipboard (Ctrl+V / Cmd+V), or drag a file onto the left box, or click it to browse local files, or pick one of the demos below.
Step 2 — Adjust lens: use the sliders to move it, change its mass, or switch mass profile.

Paste, drag, or click to load any image

A photo, screenshot, anything works —
try Ctrl+V / Cmd+V right now

source plane

lensed output

image plane

0.20
0.00
0.00
0.30
45°
Or load a built-in demo:
How is the lensed image computed? For each output pixel at angular position θ, this solves the lens equation β = θ − α(θ) to find the source-plane position β, then samples the source image there (inverse ray tracing).

Singular Isothermal Sphere (SIS) deflection: α = θ_E · (θ−θ_L)/|θ−θ_L|. Navarro-Frenck-White profile (NFW) adds a softening core radius. Elliptical Power Law (EPL) applies an elliptical coordinate transformation.