Py5Graphics.pixel_density

Get the pixel density of the Py5Graphics drawing surface.

Description

Get the pixel density of the Py5Graphics drawing surface. By default this is 1 but it can be changed by calling pixel_density() in settings().

When the pixel density has been set to more than 1, it changes all of the pixel operations including the way Py5Graphics.get(), Py5Graphics.blend(), Py5Graphics.copy(), Py5Graphics.update_pixels(), and Py5Graphics.update_np_pixels() all work. See the reference for Py5Graphics.pixel_width and Py5Graphics.pixel_height for more information.

Underlying Java field: PGraphics.pixelDensity

Updated on September 11, 2021 16:51:34pm UTC