# Saving image from CreateGraphics doubles resolution

**URL:** <https://discourse.processing.org/t/saving-image-from-creategraphics-doubles-resolution/13160>\
**Category:** Coding Questions\
**Created:** [August 3, 2019, 10:11pm UTC](https://discourse.processing.org/t/saving-image-from-creategraphics-doubles-resolution/13160 "2019-08-03T22:11:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkdnson](https://avatars.discourse-cdn.com/v4/letter/r/cc9497/32.png) [@rkdnson](https://discourse.processing.org/u/rkdnson)\
**Post date:** [August 3, 2019, 10:11pm UTC](https://discourse.processing.org/t/saving-image-from-creategraphics-doubles-resolution/13160/1 "2019-08-03T22:11:32Z")

</div>

Hello!

I am working on a bit of code, and have recently put in the createGraphics() function. When saving the image created by createGraphics, my resolution is doubled.

```auto
print(graphics.width); //gives me 800 - the correct width.
print(graphics.height); //gives me 600 - the correct height.

```

after saving the image my dimensions are 1600x1200. This was not the case when I was defining the image from the canvas 0,0 point (not using createGraphics).

My goal with using createGraphics is that I could manipulate where the image is on the screen and save it at its correct resolution wherever it may be located.

Thanks all!

**edit**  
quickly made another sketch with nothing else in it to demonstrate the issue.  
[https://editor.p5js.org/TedCharlesBrown/sketches/Sc-Qk9qll\*](https://editor.p5js.org/TedCharlesBrown/sketches/Sc-Qk9qll*)

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [August 4, 2019, 12:37am UTC](https://discourse.processing.org/t/saving-image-from-creategraphics-doubles-resolution/13160/2 "2019-08-04T00:37:41Z")

</div>

if you use

```auto
pixelDensity(1);

```

it works here,  
play with  
[https://editor.p5js.org/kll/sketches/I\_NCyfDYR](https://editor.p5js.org/kll/sketches/I_NCyfDYR)  
and shows here:

```auto
 org pdensity 2 
 org ddensity 1.25 
 set density 1 
 graphics.width 100 

```

even the pixel and display density not fully clear.

also i not try to set it for the graphics object only?possible?
