GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Change the default display density by Stefterv · Pull Request #1038 · processing/processing4

Conversation

@Stefterv

@Stefterv Stefterv commented Apr 15, 2025

Copy link
Copy Markdown
Member

Fixes #950

Changes the default sketch density to reflect the current display in use.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Stefterv
Change the default display density
73d3aeb
@Stefterv Stefterv added this to the 4.4.3 milestone Apr 15, 2025
@SableRaf SableRaf added this to Processing Roadmap Apr 19, 2025
@SableRaf SableRaf moved this to In progress in Processing Roadmap Apr 19, 2025
SableRaf
SableRaf approved these changes Apr 25, 2025
View reviewed changes
@SableRaf
SableRaf merged commit 732b20c into processing:main Apr 25, 2025
@github-project-automation github-project-automation Bot moved this from In progress to Done in Processing Roadmap Apr 25, 2025
@Stefterv
Stefterv deleted the default-display-density branch May 15, 2025 11:55
@tychedelia tychedelia mentioned this pull request Jun 2, 2025
Regression in 4.4.3: get() and set() are reading and writing from/to the wrong coordinates. #1131
Open
@golanlevin golanlevin mentioned this pull request Jun 12, 2025
Substituting an svg file in PEmbroider_svg_image.pde produces noisy square CreativeInquiry/PEmbroider#114
Closed
golanlevin added a commit to CreativeInquiry/PEmbroider that referenced this pull request Jun 12, 2025
@golanlevin
Update PEmbroider_svg_image.pde
c85d335
In processing/processing4#1038, Processing modified the default display density, which changes how sketches allocate pixels and breaks many PEmbroider examples. The temporary fix is to use `pixelDensity(1)`.
golanlevin added a commit to CreativeInquiry/PEmbroider that referenced this pull request Jun 12, 2025
@golanlevin
Update PEmbroider_shape_hatching_1.pde
e7e8aa1
Fixes breaking change caused by processing/processing4#1038.
@golanlevin golanlevin mentioned this pull request Jun 12, 2025
ALERT: PEmbroider now requires pixelDensity(1) for proper operation in Processing 4.4.3+ CreativeInquiry/PEmbroider#115
Open
@tychedelia tychedelia mentioned this pull request Jun 13, 2025
Resolution of window scales poorly leading to bad render #1142
Open
agreyson
agreyson reviewed Aug 20, 2025
View reviewed changes
Comment thread core/src/processing/core/PApplet.java
sketch.present = present;
sketch.fullScreen = fullScreen;

sketch.pixelDensity = sketch.displayDensity();

@agreyson agreyson Aug 20, 2025

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stumbled across this just now while helping a new CS teacher come up to speed on one of my former class projects. The project uses a nested loop and the width and height system variables to change the color of each pixel in the pixels array (as described in chapter 15 of Shiffman's "Learning Processing"). As of this change, that same loop only modifies the pixels in a small portion of the display window on my high DPI laptop. It's a nasty little bug if you haven't faithfully kept up with the Processing release notes. Perhaps you could display a warning message to ease folks into it?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@SableRaf SableRaf Aug 21, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @agreyson Thanks for your comment! We made this change because sketches looked blurry on high-DPI displays, but as you found out, it can break older code that works with pixels directly. This happens because different pixelDensity values introduce inconsistencies in per-pixel operations. @catilac and @tychedelia are exploring solutions here: #1145, and suggestions are welcome on the issue thread: #1131. Since the fix is more complex than expected, adding a warning message could be a helpful interim step to prevent the headaches you ran into. Thanks for your suggestion.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@agreyson agreyson Aug 21, 2025

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @SableRaf. I appreciate the speedy response! Given that this breaks a substantial chunk of @shiffman instructional materials, my recommendation would be to revert #1038 for now, and leave it to knowledgable developers to call pixelDensity explicitly until you've found a solution (easier said than done, judging by the commentary). Thank you for your work on Processing, and best of luck!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

SableRaf reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@SableRaf SableRaf mentioned this pull request Jul 20, 2026
Display detection fails in Processing 4.5.6 on macOS + pixelDensity() #1551
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@SableRaf SableRaf SableRaf approved these changes
+1 more reviewer
@agreyson agreyson agreyson left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

Processing Roadmap
Status: Completed

Milestone

4.4.3

Development

Successfully merging this pull request may close these issues.

Set default pixel density to the display's density

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Stefterv @SableRaf @agreyson
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.