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 by p5.js Contributors and the Processing Foundation is licensed under CC BY-NC-SA 4.0.