# Why are sketches larger with the Default Renderer than with P2D? Should I be concerned?

**URL:** <https://discourse.processing.org/t/why-are-sketches-larger-with-the-default-renderer-than-with-p2d-should-i-be-concerned/34949>\
**Category:** Processing\
**Created:** [February 3, 2022, 3:49am UTC](https://discourse.processing.org/t/why-are-sketches-larger-with-the-default-renderer-than-with-p2d-should-i-be-concerned/34949 "2022-02-03T03:49:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![leatherbird](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@leatherbird](https://discourse.processing.org/u/leatherbird)\
**Post date:** [February 3, 2022, 3:49am UTC](https://discourse.processing.org/t/why-are-sketches-larger-with-the-default-renderer-than-with-p2d-should-i-be-concerned/34949/1 "2022-02-03T03:49:53Z")

</div>

Hello,  
Beginner question, not sure what is happening. Or which size is correct.  
If I don’t include P2D, the sketch appears much larger.  
Is this normal? Or is there a setting somewhere I need to address?

Processing 4.04b4  
Windows 10, RTX 2080Ti, 3840 x 2160 monitor.

 ![defaultbigger](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/af61b71929971652bc7cad4b2f0a10a05776067a.png)  
 ![p2dsmaller](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/5/506ffac5cd7093406270c526266ce3e1fe44f1b8.png)

---

<div class="post-metadata">

**Author:** ![FurryNightShade](https://avatars.discourse-cdn.com/v4/letter/f/e5b9ba/32.png) [@FurryNightShade](https://discourse.processing.org/u/FurryNightShade)\
**Post date:** [February 3, 2022, 4:51pm UTC](https://discourse.processing.org/t/why-are-sketches-larger-with-the-default-renderer-than-with-p2d-should-i-be-concerned/34949/2 "2022-02-03T16:51:57Z")

</div>

It doesnt happen to me. Try calling `println(displayDensity());` or something, that would tell you, how do the 500x500 pixels fit within that window.

---

<div class="post-metadata">

**Author:** ![leatherbird](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@leatherbird](https://discourse.processing.org/u/leatherbird)\
**Post date:** [February 4, 2022, 12:29am UTC](https://discourse.processing.org/t/why-are-sketches-larger-with-the-default-renderer-than-with-p2d-should-i-be-concerned/34949/3 "2022-02-04T00:29:24Z")

</div>

Hmmm… They both say “2” with `println(displayDensity())`  
Any other thoughts? Is this bad?

 ![default2](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/8/8055ff90de0db970cf49456c688e283f436072d6.png)  
 ![p2d2](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/f/f8ab7e583d2d9d9e5e3afcd8de43bc220da959eb.png)

---

<div class="post-metadata">

**Author:** ![FurryNightShade](https://avatars.discourse-cdn.com/v4/letter/f/e5b9ba/32.png) [@FurryNightShade](https://discourse.processing.org/u/FurryNightShade)\
**Post date:** [February 4, 2022, 4:18pm UTC](https://discourse.processing.org/t/why-are-sketches-larger-with-the-default-renderer-than-with-p2d-should-i-be-concerned/34949/4 "2022-02-04T16:18:44Z")

</div>

Well, you have a high-dpi screen. That might be the thing. `displayDensity()` just returns `2` if you have a high-dpi screen or `1` if you don’t. ([displayDensity()](https://processing.org/reference/displayDensity_.html), [PApplet.pixelDensity()](https://github.com/processing/processing/blob/a6a86250ffa4041b7d77fbb66dc02e78360c64f0/core/src/processing/core/PApplet.java#L1139))  
Try to run the same sketch on a 1080p monitor. These are my results on my 1920x1080 screen:

 ![Test with unspecified renderer](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/3/393f00f2aee4fff0959eac73c447d30596be5ab5.png)  
 ![Test with P2D renderer](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/4b26268c82fcfd1d8436a2cec3db39fa8979fb1d.png)

If you don’t specify a renderer in the `size(width, height)` method, the default renderer will be chosen, which is **JAVA2D**. ([PApplet.createGraphics()](https://github.com/processing/processing/blob/a6a86250ffa4041b7d77fbb66dc02e78360c64f0/core/src/processing/core/PApplet.java#L2128), [PApplet.size()](https://github.com/processing/processing/blob/a6a86250ffa4041b7d77fbb66dc02e78360c64f0/core/src/processing/core/PApplet.java#L2128))

You can also try `size(500, 500, FX2D)`, see what happens. ([size()](https://processing.org/reference/size_.html))  
You can try `println(width, height)` or `save("path")` to see, what the PApplets PGraphics really is.  
You can also experiment with `pixelDensity(density)` and `println(sketchPixelDensity())` , ([pixelDensity()](https://processing.org/reference/pixelDensity_.html), [PApplet.sketchPixelDensity()](https://github.com/processing/processing/blob/a6a86250ffa4041b7d77fbb66dc02e78360c64f0/core/src/processing/core/PApplet.java#L1118))

There are many bugs with Processing 4 and sketch windows, so this might be one of them. One bug that happened to me is with `surface.setResizable(true)`, where when you try to resize the sketch window, it throws an error or just simply freezes.

 ![surface.setResizable(true) bug 1](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/6964cd4f58ef4ecd9dd15a75571433d0ef4f5da7.png) ![surface.setResizable(true) bug 2](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/0/044693d126e47b5948e679239ea2ed1ab472a032.png)  
You are better off still using Processing 3 and its outdated Java 8 (or whatever it uses) until most of the bugs are fixed.

---

<div class="post-metadata">

**Author:** ![leatherbird](https://avatars.discourse-cdn.com/v4/letter/l/6f9a4e/32.png) [@leatherbird](https://discourse.processing.org/u/leatherbird)\
**Post date:** [February 5, 2022, 2:19am UTC](https://discourse.processing.org/t/why-are-sketches-larger-with-the-default-renderer-than-with-p2d-should-i-be-concerned/34949/5 "2022-02-05T02:19:35Z")

</div>

Sounds good. I can stick with 3 until i understand what’s happening!  
Thank you.
