Increasing access
Fixing this ensures that p5.Framebuffer.get() returns high-resolution images on high-DPI displays (like Retina screens), matching user expectations. Currently it silently downsizes the image, which can confuse beginners who don't understand pixel density.
Most appropriate sub-area of p5.js?
Feature enhancement details
p5.Framebuffer.get() in src/webgl/p5.Framebuffer.js (line 1575) has a TODO: support get() at a pixel density > 1 comment.
Currently, when density > 1, the method reads the full high-resolution pixel data but then calls resize(w, h) which performs a lossy downscale — discarding the extra resolution.
The fix is to use p5.Image.pixelDensity(density) instead of resize(), so the returned image retains its full-resolution data while reporting the correct logical width and height.
Additionally, console.warn at line 1503 should use p5._friendlyError() for consistency with FES.
Increasing access
Fixing this ensures that p5.Framebuffer.get() returns high-resolution images on high-DPI displays (like Retina screens), matching user expectations. Currently it silently downsizes the image, which can confuse beginners who don't understand pixel density.
Most appropriate sub-area of p5.js?
Feature enhancement details
p5.Framebuffer.get()in src/webgl/p5.Framebuffer.js (line 1575) has aTODO: support get() at a pixel density > 1comment.Currently, when
density > 1, the method reads the full high-resolution pixel data but then calls resize(w, h) which performs a lossy downscale — discarding the extra resolution.The fix is to use
p5.Image.pixelDensity(density)instead of resize(), so the returned image retains its full-resolution data while reporting the correct logical width and height.Additionally,
console.warnat line 1503 should usep5._friendlyError()for consistency with FES.