Skip to content
Search Journal
Search journal entries and projects across Journal.
Frontend Engineeringdeep dive

Pixelflow

A large image collection rendered with Canvas, backed by worker-based data lookup, prioritised image loading, decoded-image caching and a bounded screen-reader representation.

Pixelflow carries the Canvas rendering approach from Chronos into a collection of real photographs. The dataset contains 24,997 image records across 50 chunks. Instead of creating an image element for every record, Pixelflow keeps the collection as data and draws the visible images onto Canvas.

The added complexity is the image resource pipeline. Each image must be fetched, decoded and kept available for drawing, and the user may have scrolled elsewhere before that work finishes.

Data and rendering

A Web Worker owns dataset lookup and returns bounded ranges for the viewport. The main thread coordinates image resources and Canvas rendering. Requests crossing the worker message boundary are validated at runtime; unsupported message types and invalid ranges fail explicitly.

The renderer draws the viewport and its overscan region. The worker handles record lookup, while the image pipeline prepares decoded resources. Keeping those responsibilities separate means the renderer does not need to know how the dataset is stored, and the worker does not need to know how images are painted.

Image pipeline

Visible images receive priority. Nearby images are prepared through overscan after a 120 ms settle delay. Obsolete requests can be aborted when the viewport changes, and duplicate requests reuse in-flight work.

Operation Concurrent work
Image fetches 6
Image decoding 4

Decoded ImageBitmap instances are held in an LRU cache capped at 48 entries. The browser’s HTTP cache serves a different purpose: it can avoid downloading image bytes again after a decoded bitmap has been evicted. Image failures are aggregated and surfaced through a toast rather than producing one notification per failed image.

Accessibility

Canvas is marked aria-hidden="true". A bounded, visually hidden semantic DOM layer exposes the current viewport’s photograph information and photographer attribution, including aria-posinset and aria-setsize. It follows the same bounded-window model as the renderer rather than creating accessible entries for all 24,997 records.

I tested the result with VoiceOver on macOS and iPhone. The semantic layer gives assistive technology actual HTML content to navigate while keeping the visual collection on Canvas.

Result

The final rendering work reached more than 115 FPS on desktop, with an observed run reaching around 120 FPS, and around 58–60 FPS on an older iPhone. The measured page recorded an LCP of 0.30 seconds and CLS of 0.00. A live performance dock exposes render time and loaded-image counts during interaction.