# Performance issues with PGraphics layers and image() calls

**URL:** <https://discourse.processing.org/t/performance-issues-with-pgraphics-layers-and-image-calls/48929>\
**Category:** Coding Questions\
**Created:** [July 1, 2026, 1:19pm UTC](https://discourse.processing.org/t/performance-issues-with-pgraphics-layers-and-image-calls/48929 "2026-07-01T13:19:59Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [July 2, 2026, 10:36pm UTC](https://discourse.processing.org/t/performance-issues-with-pgraphics-layers-and-image-calls/48929/5 "2026-07-02T22:36:56Z")

</div>

Hello @Braunstein,

I was inspired by your topic and shared code in the Gallery:  
_[Processing PGraphics Image Scaling and Renderer Test](https://discourse.processing.org/t/processing-pgraphics-image-scaling-and-renderer-test/48944/1)_

_Tatooine_ came to mind and I found the image (classic scene) I was remembering:

> **[Scientists discover 3 Earth-size exoplanets that may have double sunsets —...](https://www.space.com/astronomy/exoplanets/scientists-discover-3-earth-size-exoplanets-that-may-have-double-sunsets-like-tatooine-in-star-wars)**
>
> Scientists discover 3 Earth-size exoplanets that may have double sunsets — like Tatooine in Star Wars

I saw the first movie in the theatre! Good memories.

I have done similar in the past and have encountered the same performance and other issues.

1. JAVA2D uses CPU rendering; `image(pg, a, b, c, d)` resizing is slow for a PGraphic.

2. P2D uses GPU rendering; `image(pg, a, b, c, d)` resizing is faster for a PGraphic.

3. In JAVA2D you can also copy the _PGraphic_ canvas directly into a _PImage_ and _resize_ which is faster than 1:

```auto
    PImage target = pgSun.get();  
    target.resize(900, 900);
    image(target, 0, 0);

```

It was getting late so scrutinize and test the content provided.

Have fun!

`:)`

---

_[View the full topic](https://discourse.processing.org/t/performance-issues-with-pgraphics-layers-and-image-calls/48929)._
