Skip to content

Commit

Permalink
Merge pull request #6099 from radarhere/pixels
Browse files Browse the repository at this point in the history
Document alternatives to accessing individual pixels
  • Loading branch information
hugovk committed Mar 6, 2022
2 parents 180c89f + 4615e1d commit fe9b699
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
10 changes: 8 additions & 2 deletions docs/reference/PixelAccess.rst
Expand Up @@ -6,7 +6,13 @@
The PixelAccess class provides read and write access to
:py:class:`PIL.Image` data at a pixel level.

.. note:: Accessing individual pixels is fairly slow. If you are looping over all of the pixels in an image, there is likely a faster way using other parts of the Pillow API.
.. note:: Accessing individual pixels is fairly slow. If you are
looping over all of the pixels in an image, there is likely
a faster way using other parts of the Pillow API.

:mod:`~PIL.Image`, :mod:`~PIL.ImageChops` and :mod:`~PIL.ImageOps`
have methods for many standard operations. If you wish to perform
a custom mapping, check out :py:meth:`~PIL.Image.Image.point`.

Example
-------
Expand Down Expand Up @@ -39,7 +45,7 @@ Access using negative indexes is also possible.
:py:class:`PixelAccess` Class
-----------------------------------
-----------------------------

.. class:: PixelAccess

Expand Down
8 changes: 6 additions & 2 deletions docs/reference/PyAccess.rst
Expand Up @@ -7,8 +7,12 @@
The :py:mod:`~PIL.PyAccess` module provides a CFFI/Python implementation of the :ref:`PixelAccess`. This implementation is far faster on PyPy than the PixelAccess version.

.. note:: Accessing individual pixels is fairly slow. If you are
looping over all of the pixels in an image, there is likely
a faster way using other parts of the Pillow API.
looping over all of the pixels in an image, there is likely
a faster way using other parts of the Pillow API.

:mod:`~PIL.Image`, :mod:`~PIL.ImageChops` and :mod:`~PIL.ImageOps`
have methods for many standard operations. If you wish to perform
a custom mapping, check out :py:meth:`~PIL.Image.Image.point`.

Example
-------
Expand Down

0 comments on commit fe9b699

Please sign in to comment.