create_graphics(), height, renderer='P2D')

Creates and returns a new off-screen graphics buffer that you can draw on

  • width (int) – width of the offscreen graphics buffer in pixels
  • height (int) – height of the offscreen graphics buffer in pixels
  • renderer (constant) – Default P2D, and only available in skia renderer

Off screen graphics buffer

Return type:




Thin wrapper around a renderer, to be used for creating a graphics buffer object. Use this class if you need to draw into an off-screen graphics buffer. The two parameters define the width and height in pixels. The fields and methods for this class are extensive, but mirror the normal drawing API for p5.

Graphics object are not meant to be used directly in sketches. User should always use create_graphics to make an offscreen buffer


list of weak references to the object (if defined)