# Loading a .PNG image into PGraphics

**URL:** <https://discourse.processing.org/t/loading-a-png-image-into-pgraphics/28064>\
**Category:** Coding Questions\
**Created:** [February 24, 2021, 8:15pm UTC](https://discourse.processing.org/t/loading-a-png-image-into-pgraphics/28064 "2021-02-24T20:15:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![IRIGIMA](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/irigima/32/8951_2.png) [@IRIGIMA](https://discourse.processing.org/u/IRIGIMA)\
**Post date:** [February 24, 2021, 8:15pm UTC](https://discourse.processing.org/t/loading-a-png-image-into-pgraphics/28064/1 "2021-02-24T20:15:11Z")

</div>

Is there a very simple way of loading an image into PGraphics?

I’m currently rendering direct to PGraphics and saving this as an image file:  
“1.PNG”  
If I want to continue the render, I need to load this image back into PGraphics and continue with render.

Any ideas?? And any position / scale options available.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![paulgoux](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@paulgoux](https://discourse.processing.org/u/paulgoux)\
**Post date:** [February 24, 2021, 8:38pm UTC](https://discourse.processing.org/t/loading-a-png-image-into-pgraphics/28064/2 "2021-02-24T20:38:22Z")

</div>

See pgraphics reference

[https://processing.org/reference/PGraphics.html](https://processing.org/reference/PGraphics.html)

As for scaling

[https://processing.org/reference/scale\_.html](https://processing.org/reference/scale_.html)

Which must be used in combination with matrix pop and push.

[https://processing.org/reference/pushMatrix\_.html](https://processing.org/reference/pushMatrix_.html)

```auto
void draw() {
  pg.beginDraw();
  pg.background(100);
  pg.stroke(255);
  pg.image(img, 0,0);
  pg.endDraw();
  
}

```

Where pg is your pgraphics object and img is a pimage object.  
Sorry i cant offer concrete examples, currently using my phone.

---

<div class="post-metadata">

**Author:** ![IRIGIMA](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/irigima/32/8951_2.png) [@IRIGIMA](https://discourse.processing.org/u/IRIGIMA)\
**Post date:** [February 24, 2021, 9:53pm UTC](https://discourse.processing.org/t/loading-a-png-image-into-pgraphics/28064/3 "2021-02-24T21:53:51Z")

</div>

Thank you so much!!  
Works perfectly.

What I am currently working on:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/7eaa331891460ef72f9c4246400b55fc04a806a5.jpeg)
