Py5Image.pixel_width#

Width of the Py5Image object in pixels.

Examples#

1def setup():
2    py5.pixel_density(2)
3    img = py5.create_image(100, 100, py5.RGB)
4    py5.println(img.pixel_density, img.pixel_width, img.pixel_height)  # prints 1, 100, 100

Description#

Width of the Py5Image object in pixels. This will be the same as Py5Image.width, even if the Sketch used pixel_density() to set the pixel density to a value greater than 1.

Underlying Processing field: PImage.pixelWidth

Updated on November 12, 2021 11:30:58am UTC