diff --git a/docs/reference/PixelAccess.rst b/docs/reference/PixelAccess.rst index 5389dab33..522e70937 100644 --- a/docs/reference/PixelAccess.rst +++ b/docs/reference/PixelAccess.rst @@ -28,6 +28,13 @@ Results in the following:: (23, 24, 68) (0, 0, 0) +Access using negative indexes is also possible. + +.. code-block:: python + + px[-1,-1] = (0,0,0) + print (px[-1,-1]) + :py:class:`PixelAccess` Class diff --git a/docs/reference/PyAccess.rst b/docs/reference/PyAccess.rst index 8bd8af9ff..6a492cd86 100644 --- a/docs/reference/PyAccess.rst +++ b/docs/reference/PyAccess.rst @@ -29,6 +29,13 @@ Results in the following:: (23, 24, 68) (0, 0, 0) +Access using negative indexes is also possible. + +.. code-block:: python + + px[-1,-1] = (0,0,0) + print (px[-1,-1]) + :py:class:`PyAccess` Class diff --git a/docs/releasenotes/5.4.0.rst b/docs/releasenotes/5.4.0.rst index df0622cdc..421ebbbf2 100644 --- a/docs/releasenotes/5.4.0.rst +++ b/docs/releasenotes/5.4.0.rst @@ -1,6 +1,19 @@ 5.4.0 (unreleased) ----- +API Changes +=========== + +Negative indexes in pixel access +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +When accessing individual image pixels, negative indexes are now also accepted. +For example, to get or set the farthest pixel in the lower right of an image:: + + px = im.load() + print(px[-1, -1]) + px[-1, -1] = (0, 0, 0) + Other Changes =============