Rendering graphics and animations.
<svg>
<canvas>
colorSpace
ctx.drawElement()
<model>
navigator.xr
Embed SVG vector graphics directly in markup
<svg> <circle cx="50" cy="50" r="50" /> </svg>
Element for drawing dynamic 2D or 3D graphics using JavaScript.
<canvas width="200" height="200"></canvas>
Set the color space for the graphics being drawn on a <canvas> element.
const ctx = canvas.getContext("2d", {colorSpace: "display-p3"});
Draw an HTML element on <canvas>, with conveniences for redrawing and hit testing.
<canvas id="canvas" layoutsubtree="true"> <p>Hello world!</p> </canvas> <script type="module"> const ctx = canvas.getContext("2d"); const text = canvas.querySelector("p"); ctx.drawElement(text, 30, 0); </script>
Allows embedding 3D models in HTML with built-in controls.
<model src="3d-assets/car.glb"></model>
Create AR/VR sessions with compatible output devices.
const xr = navigator.xr; const session = await xr?.requestSession("immersive-vr");
A JavaScript API that provides low-level access to the GPU for high-performance graphics and parallel computation in the browser.
const adapter = await navigator.gpu.requestAdapter(); const device = await adapter?.requestDevice();
A low-level API for rendering 2D and 3D graphics with the GPU on <canvas> , based on OpenGL.
const gl = canvas.getContext("webgl");
An image format optimized for web environments.
<img src="image.jxl" />