update_np_pixels()

update_np_pixels()#

Updates the display window with the data in the np_pixels[] array.

Examples#

example picture for update_np_pixels()

def setup():
    img = py5.load_image("rockies.jpg")
    py5.image(img, 0, 0)
    py5.load_np_pixels()
    py5.np_pixels[50:100, :, :] = py5.np_pixels[:50, :, :]
    py5.update_np_pixels()

Description#

Updates the display window with the data in the np_pixels[] array. Use in conjunction with load_np_pixels(). If you’re only reading pixels from the array, there’s no need to call update_np_pixels() — updating is only necessary to apply changes.

The update_np_pixels() method is similar to update_pixels() in that update_np_pixels() must be called after modifying np_pixels[] just as update_pixels() must be called after modifying pixels[].

Signatures#

update_np_pixels() -> None

Updated on March 06, 2023 02:49:26am UTC