15 releases (breaking)

Uses new Rust 2024

new 0.11.0 Jun 4, 2026
0.9.0 May 10, 2026
0.8.0 Mar 25, 2026
0.6.2 Oct 30, 2025
0.0.0 Nov 26, 2024

#114 in Graphics APIs

Download history 468/week @ 2026-02-13 690/week @ 2026-02-20 701/week @ 2026-02-27 884/week @ 2026-03-06 1189/week @ 2026-03-13 1331/week @ 2026-03-20 1065/week @ 2026-03-27 812/week @ 2026-04-03 859/week @ 2026-04-10 1176/week @ 2026-04-17 1079/week @ 2026-04-24 1487/week @ 2026-05-01 1757/week @ 2026-05-08 1474/week @ 2026-05-15 1368/week @ 2026-05-22 1968/week @ 2026-05-29

6,777 downloads per month
Used in 30 crates (12 directly)

MIT/Apache

95KB
1.5K SLoC

2D drawing abstraction that allows applications/frameworks to support many rendering backends through a unified API.

Painting a scene

The core abstraction in AnyRender is the PaintScene trait.

PaintScene is a "sink" which accepts drawing commands:

  • Applications and libraries draw by pushing commands into a PaintScene
  • Backends execute those commands to produce an output

Rendering to surface or buffer

In addition to PaintScene, there is:

  • The ImageRenderer trait which provides an abstraction for rendering to a Vec<u8> RGBA8 buffer.
  • The WindowRenderer trait which provides an abstraction for rendering to a surface/window

SVG

The anyrender_svg crate allows SVGs to be rendered using AnyRender

WASM support

Wgpu adapter/device/surface initialization is fundamentally async on the web. To avoid deadlocking the JS event loop, WindowRenderer::resume takes an on_ready callback: GPU backends spawn the init on wasm_bindgen_futures::spawn_local and invoke the callback once the surface is live. The embedder then calls WindowRenderer::complete_resume to transition the renderer to the active state. On native targets the same code path runs inline (pollster::block_on on the GPU backends), so callers see no behavioural difference.

Backends

Currently existing backends are:

Dependencies

~1.5MB
~27K SLoC