Question about PixelDensity
See original GitHub issuethanks for this library, its cool.
I ran into something - if I set pixelDensity(displayDensity()); in my sketch to work in HiDPI , seems that the imageprocessing library might not be compatible, it throws a lot of exceptions with TiltShift , Threshold, etc.
Do I need to set something in the constructor?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Pixel Density, Demystified - Medium
Pixel density refers to how many pixels have been… ... and consider this question: should a button always be the same physical size...
Read more >Question about pixel density : r/buildapc - Reddit
This leads me to my question.Would a 1080p 32 inch screen look good or would the 1080 pixels be too stretched out across...
Read more >[Solved] What is Pixel density? - Testbook.com
This question was previously asked in. UGC NET Paper 1: Held on 4th Jan 2022 Shift 2 ... Pixel density is commonly measured...
Read more >View question - pixel density
What is the pixel density (in PPI) for a mobile device which has a screen size of 4 inches on the diagonal and...
Read more >Solved Question 4 What will be the pixel density (PPI) for
Transcribed image text: Question 4 What will be the pixel density (PPI) for the screen whose resolution is 300 x 400 and screen...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thank you for your reply.
I took over the MacBook of my lovly wife ❤️ and do some tests. The main problem is, that createGraphics sets the pixelWidth and pixelHeight values for PGraphics depending on the pixelDensity-value. Instead PImage has pixelWidth and pixelHeight regular.
In the end the line sharp.mask() fails, because the two images have different dimensions.
With f2f1a4dfc670b5f7315fdd7891de2765f9ca932b I commited a workarround to avoid that error. Instead of image.copy() I wrote a method to copy an image by redrawing it on PGraphics. In that way the result has the same width and height attributes.
For Classes that using PGraphics I could not reproduce this error.
delving deeper into some debugging… this issue affects TiltShift ( this one I use its very cool ) and Blend and the others that create off screen
PGraphicswhen TiltShift is applied and PixelDensity is 2, then that
PGraphics mask = image.parent.createGraphics(image.width, image.height);seems to fail…