Refract
Refract Transform, Optimize, Deliver
On-the-fly image delivery

The URL is the darkroom.


Refract turns a plain image address into a set of instructions — width, format, crop, blur — and renders the result at the edge, the moment it is asked for.

Three shallow developing trays set in a long sink under a dim safelight, still liquid catching the light.
Fig. 1 — A darkroom under safelight: three developing trays in a long sink, the last analogue stage before an image is fixed.

Refract points at an image you already host, and never asks for a copy of it. Each original is fetched from your origin on demand, rendered into the variant a URL describes, and cached at the edge; the source is kept only as long as the transform takes, and is never stored permanently. What reaches the browser is precisely the picture the parameters asked for — and nothing was re-uploaded to make it.

A darkroom enlarger easel holding a single blank sheet of paper, a bright rectangle of projected light falling across it.

Transform

Ten chainable URL parameters resize, recut, rotate, and blur an image. Smart crop keeps the subject in frame while the frame around it changes.

A stack of neutral-density glass filters resting edge-on on a glowing lightbox, each sheet slightly offset from the last.

Optimize

fm=auto negotiates AVIF, WebP, or JPEG from the request's Accept header, trimming an average of 62% from the source JPEG without a line of markup changing.

A lattice relay tower standing on a bare hillside at dusk, small dishes at its crown, a plain open sky behind it.

Deliver

41 edge locations answer a cached request in a median of 21 ms, at a 98.6% hit ratio; a cold transform clears in 89 ms at the median, 340 ms at the tail.

The transform, live

The line beneath a picture is written after the picture. Here it is written by you, and the picture obeys it. Change any word set in black and the plate at the right repaints — no request is in flight, and nothing is fetched.

A red iron fire escape zig-zagging up the left of a sunlit brick wall — the source photograph.
The same source photograph, rendered to the parameters set in the caption.
Fig. 2 — Left, the source. Right, the same source rendered 1200 px wide, at its own height, , unblurred. Format, quality and pixel ratio are not set in this browser.
https://demo.refract.dev/hero.jpg?w=1200&fm=auto&q=80

The sentence grows. Set a height and it takes a fit; a fit that crops takes a crop; contain opens a letterbox, and a letterbox takes a bg. Three of the seven are waiting on that height.

Not controls. fm=auto resolves AVIF → WebP → JPEG from the request's Accept header and q is applied at the edge — a browser cannot demonstrate either re-encode. dpr is reported by the browser itself.

By the numbers
62%
Average payload reduction versus source JPEG
21 ms
Median cached response
98.6%
Cache hit ratio
99.95%
Uptime SLA, on the Scale plan

The reference is three pages long, and the first transform is one line of code. Start where the parameters are documented.

Start building
1 / 3