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.
Related writing
- Building Responsive Data Pipelines in the Browser
A look at worker ownership, typed storage, bounded work and viewport-driven queries across browser applications.
- When to Build a Primitive and When to Use a Library
A practical way to decide which parts of a system deserve custom engineering and which should rely on established browser or ecosystem primitives.
- The Engineering of Bounded Memory
Memory limits become useful when the application accounts for retained resources and defines what happens at the boundary.
- Beyond the Comfort Zone: Pushing Canvas Beyond Games and Drawing
What changed when I used Canvas for dense interfaces, first with 100,000 timers and then with a large image collection, and where this rendering model makes sense.
- Designing Bounded Workloads in Browser Applications
How concurrency limits, cancellation, cache budgets and queue thresholds keep browser applications responsive under changing demand.
- Accessibility for Interfaces Rendered on Canvas
Canvas can render dense interfaces efficiently while a bounded semantic DOM layer preserves keyboard and assistive-technology access.
- The Browser as an Execution Environment
Workers, WebAssembly, typed arrays and browser APIs make the browser a capable runtime for substantial local computation.