.. module:: p5 :noindex:
.. autoclass:: PImage :members: :special-members:
.. function:: image(img, x, y) :noindex:
.. function:: image(img, x, y, w, h) :noindex:
.. autofunction:: image(img, location, size=None)
.. autofunction:: image_mode
.. autofunction:: load_image
.. autofunction:: tint :noindex:
.. autofunction:: no_tint :noindex:
.. autofunction:: save_canvas :noindex:
.. autofunction:: load_pixels
A :class:`p5.PImage` containing the values for all the pixels in the
display window. The size of the image is that of the main rendering
window, width × height. This image is only available within the
:meth:`p5.load_pixels` context manager and set to None
otherwise.
with load_pixels():
# code manipulating the ``pixels`` object
Subsequent changes to this image object aren't reflected until :meth:`p5.load_pixels` is called again. The contents of the display are updated as soon as program execution leaves the context manager.