# Canvas size / dimensions on save

**URL:** <https://discourse.processing.org/t/canvas-size-dimensions-on-save/22829>\
**Category:** Coding Questions\
**Created:** [July 25, 2020, 12:14pm UTC](https://discourse.processing.org/t/canvas-size-dimensions-on-save/22829 "2020-07-25T12:14:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Honkitonkie](https://avatars.discourse-cdn.com/v4/letter/h/dec6dc/32.png) [@Honkitonkie](https://discourse.processing.org/u/Honkitonkie)\
**Post date:** [July 25, 2020, 12:14pm UTC](https://discourse.processing.org/t/canvas-size-dimensions-on-save/22829/1 "2020-07-25T12:14:52Z")

</div>

Hello,

When I create a canvas of 1200\*627 and save it (saveCanvas or manually) the dimensions change to 2400 \* 1254. I believe this didn’t occur before so I figured it must be something I’ve done that triggered this but with this simple example having the same effect I ran out of ideas.

Can anybody tell me why this is happening, did something change and/or how can I adjust this so that the dimensions stay the same.

If not any of above any information about this would be greatly appreciated.

index file:

```auto
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <script src="https://cdn.jsdelivr.net/npm/p5@1.1.8/lib/p5.js"></script>
    <script src="sketch.js"></script>
    <title></title>
  </head>
  <body>
  </body>
</html>

```

sketch file:

```auto
function setup() {
  let c = createCanvas(1200, 627);
  background(220);
  saveCanvas(c, 'myCanvas', 'jpg');  
}

```

 ![myCanvas (3)](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/d/d8b0c8765e93df76f2057558fc77fea5284b92ee.jpeg)

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [July 25, 2020, 1:30pm UTC](https://discourse.processing.org/t/canvas-size-dimensions-on-save/22829/2 "2020-07-25T13:30:11Z")

</div>

Dunno. Maybe use `pixelDensity(1);`:  
[p5js.org/reference/#/p5/pixelDensity](http://p5js.org/reference/#/p5/pixelDensity)

---

<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 25, 2020, 2:01pm UTC](https://discourse.processing.org/t/canvas-size-dimensions-on-save/22829/3 "2020-07-25T14:01:43Z")

</div>

Hello,

I tried it on my W10 PC with the Processing P5.js mode.

It worked for:  
/\*! p5.js v0.10.2 October 14, 2019 _/  
Did not try v1.1.8 !  
/_! p5.js v1.1.9 July 22, 2020 \*/ //I jsut downloaded it and updated my local one.

`:)`

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

---

<div class="post-metadata">

**Author:** ![Honkitonkie](https://avatars.discourse-cdn.com/v4/letter/h/dec6dc/32.png) [@Honkitonkie](https://discourse.processing.org/u/Honkitonkie)\
**Post date:** [July 25, 2020, 4:01pm UTC](https://discourse.processing.org/t/canvas-size-dimensions-on-save/22829/4 "2020-07-25T16:01:37Z")

</div>

With this, the download is in the desired dimensions. Although I will keep looking for the cause it is enough to start advancing on my project once again. Thank you!
