Connection & foveation parameters
JPIP server
 
Reduce (discard DWT levels)
Parafovea ratio
Periphery ratio

What is this?

A JPIP (ISO/IEC 15444-9) foveated-decode demo. Three concentric view-window requests are sent per mouse move: a small sharp fovea around the cursor, a medium-resolution parafovea, and a coarse full-image periphery. The server streams only the precincts each region needs; the client reassembles them and decodes the composite JPEG 2000 / HTJ2K codestream. Bandwidth per frame is a small fraction of a full-image decode.

Runs entirely in your browser. The HTJ2K decoder is WebAssembly (compiled from the same C++ source as open_htj2k_dec) — no native binary, no plugin, no server-side decode. The JPIP server returns raw JPP-stream bytes; everything you see is assembled and decoded on this page.

How to operate

  1. Click Connect (the server URL is already filled in).
  2. Move the mouse over the image — the sharp fovea follows the cursor.
  3. Adjust Reduce, Parafovea ratio, Periphery ratio to trade detail for bandwidth.
  4. The stats line below the image reports fetched bytes, decode time and FPS.

Related: pan-and-zoom viewer for gigapixel images.

URL parameters & wire-format reference

URL parameters

ParameterDefaultValuesEffect
?server= host[:port] Override the JPIP server URL (same as the Server field in the top bar).
?reduce= 1 0 · 1 · 2 Discard N DWT resolution levels. 0 = full resolution; higher = faster decode, lower detail.
?para_ratio= 0.5 0.5 · 0.25 · 0.125 Parafovea fsiz ratio — the mid-resolution cone's frame size relative to the canvas.
?peri_ratio= 0.125 0.25 · 0.125 · 0.0625 Periphery fsiz ratio — lower values produce a more dramatic outside-the-fovea quality drop.
?variant= auto mt · st Force multi- or single-threaded WASM. Auto picks mt when the page is cross-origin-isolated and SIMD is available.

JPIP query (§C.4)

Every frame fires three concurrent GETs — one per cone — of the form:

/jpip?fsiz=W,H&roff=X,Y&rsiz=W,H&type=jpp-stream&model=<cache-model>

FieldMeaning
fsizTarget resolution-frame size. The server picks the smallest discard level whose decoded size ≥ fsiz.
roffRegion offset within the resolution frame.
rsizRegion size. Omit roff/rsiz for the whole frame.
type=jpp-streamThe only wire format this server speaks.
model§C.9 client cache-model advertisement — see below.

Cache-model format (§C.9)

After the first frame the demo appends &model=Hm,Ht0,M0 (single-tile image) or &model=Hm,Ht0-N,M0 (N+1 tiles) so the server skips header data-bins the client already has. Precincts are intentionally NOT tracked — the foveation demo resets precinct state per frame so the periphery decays when the gaze moves.

ClassPrefixExample
Main headerHmHm (id is always 0, so no digit)
Tile headerHtHt0, Ht1-5 (range compression)
Metadata binMM0
PrecinctPnot sent by this demo