Examples Create Graphics

Create Graphics

The createGraphics() function can be used to create a new p5.Graphics object, which can serve as an off-screen graphics buffer within the canvas. Off-screen buffers can have different dimensions and properties than their current display surface, even though they appear to be existing in the same space.

Create Graphics: Revised by Caleb Foss. Edited and maintained by p5.js Contributors and Processing Foundation. Licensed under CC BY-NC-SA 4.0.

You can find the code history of these examples here: pre-2023 example, 2023 code. You can suggest improvements by contributing to the current website!