# Render without displaying for performance

**URL:** https://discourse.processing.org/t/render-without-displaying-for-performance/32307
**Category:** Coding Questions
**Created:** [September 19, 2021, 2:34am UTC](https://discourse.processing.org/t/render-without-displaying-for-performance/32307 "2021-09-19T02:34:59Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![shishironeal](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@shishironeal](https://discourse.processing.org/u/shishironeal)
#### Post date: [September 19, 2021, 2:34am UTC](https://discourse.processing.org/t/render-without-displaying-for-performance/32307/1 "2021-09-19T02:34:59Z")

</div>

Is it possible to render frames without having to display them?  
Would this be faster than normal rendering (with JAVA2D or P2D)? (i.e. with saveFrame)

---

<div class="post-metadata">

### Author: ![CodeMasterX](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/codemasterx/32/2942_2.png) [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)
#### Post date: [September 19, 2021, 10:26am UTC](https://discourse.processing.org/t/render-without-displaying-for-performance/32307/2 "2021-09-19T10:26:01Z")

</div>

The only way I can think of, is to use PGraphics. They are the same as normal Processing canvas, but function as an image.

> **[Reference](https://processing.org/reference/PGraphics.html)**
>
> Main graphics and rendering context, as well as the base API implementation for processing "core". Use this class if you need to draw into an off-screen graphics buffer. A PGraphics object can be cons…

a thing to keep in mind is that you need to use graphic.begin/endDraw(); to change them. The rest is in the link provided.

As for performance, I have no idea. It is SLIGHTLY faster since displaying a black canvas is faster than an image but I don’t know by how much. Probably depends on the GPU you have.
