# CreateCanvas - actual size is double?

**URL:** https://discourse.processing.org/t/createcanvas-actual-size-is-double/14728
**Category:** Beginners
**Created:** [October 15, 2019, 11:14pm UTC](https://discourse.processing.org/t/createcanvas-actual-size-is-double/14728 "2019-10-15T23:14:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rdyar](https://avatars.discourse-cdn.com/v4/letter/r/6bbea6/32.png) [@rdyar](https://discourse.processing.org/u/rdyar)
#### Post date: [October 15, 2019, 11:14pm UTC](https://discourse.processing.org/t/createcanvas-actual-size-is-double/14728/1 "2019-10-15T23:14:10Z")

</div>

if I make a canvas as 400x400 like (copied from p5 editor):

```auto
function setup() {
  createCanvas(400, 400);
}

function draw() {
  background(220);
}

```

and then inspect the canvas element in Chrome I get:

`<canvas id="defaultCanvas0" class="p5Canvas" width="800" height="800" style="width: 400px; height: 400px;"></canvas>`

You can see this same exact thing on the P5 editor - just click Run and then right click \> Inspect the gray box - [https://editor.p5js.org/](https://editor.p5js.org/)

The style is 400x400, but the actual canvas is 800x800. If I right click and save the canvas and look at the file it is also 800x800.

Is this on purpose? I just updated to the latest p5 library, I don’t think the prior one I was using did this.  
Maybe this is for high density displays?

I am creating files that I want to download and have them be a specific pixel dimension so this is throwing me off a bit.

---

<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: [October 15, 2019, 11:29pm UTC](https://discourse.processing.org/t/createcanvas-actual-size-is-double/14728/2 "2019-10-15T23:29:40Z")

</div>

[p5js.org/reference/#/p5/pixelDensity](http://p5js.org/reference/#/p5/pixelDensity)

---

<div class="post-metadata">

### Author: ![rdyar](https://avatars.discourse-cdn.com/v4/letter/r/6bbea6/32.png) [@rdyar](https://discourse.processing.org/u/rdyar)
#### Post date: [October 15, 2019, 11:37pm UTC](https://discourse.processing.org/t/createcanvas-actual-size-is-double/14728/3 "2019-10-15T23:37:05Z")

</div>

thank you, that looks like it fixed it.

Also seems to be different in different browsers, Chrome was the only one changing it, FF and Edge were not.
