# Is pixelDensity() locked into scaling only to the current displayDensity()?

**URL:** https://discourse.processing.org/t/is-pixeldensity-locked-into-scaling-only-to-the-current-displaydensity/24585
**Category:** Processing
**Created:** [October 14, 2020, 4:05am UTC](https://discourse.processing.org/t/is-pixeldensity-locked-into-scaling-only-to-the-current-displaydensity/24585 "2020-10-14T04:05:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![pablohotsauce](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/pablohotsauce/32/10113_2.png) [@pablohotsauce](https://discourse.processing.org/u/pablohotsauce)
#### Post date: [October 14, 2020, 4:05am UTC](https://discourse.processing.org/t/is-pixeldensity-locked-into-scaling-only-to-the-current-displaydensity/24585/1 "2020-10-14T04:05:31Z")

</div>

I’ve got a standard (low-res) monitor. I tried to set pixelDensity() to 2, but that throws up an error at runtime saying that particular density isn’t available for my display. Only density 1 seems to be available. Shouldn’t the option to use non-native pixel densities be available to us, for testing purposes?

I know as a workaround I can create a global variable like scaleFactor and set it to whatever, and then use that as a multiplier in size() and in every equation in the sketch. But I’m curious why pixelDensity() seems to be locked to the current display’s density. Is this more of a question for GitHub?

---

<div class="post-metadata">

### Author: ![pablohotsauce](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/pablohotsauce/32/10113_2.png) [@pablohotsauce](https://discourse.processing.org/u/pablohotsauce)
#### Post date: [October 17, 2020, 11:42pm UTC](https://discourse.processing.org/t/is-pixeldensity-locked-into-scaling-only-to-the-current-displaydensity/24585/2 "2020-10-17T23:42:13Z")

</div>

Bump. Wondering if this is the default behavior and there’s no way around it, or if I’m doing something wrong. Anyone know? I ended up doing a project where I used a scale factor variable as a workaround, and … it’s kind of a pain.

EDIT: aha, apparently there’s a hack workaround to get this working on Windows / Linux: [https://github.com/processing/processing/issues/5414#issuecomment-368173545](https://github.com/processing/processing/issues/5414#issuecomment-368173545)
