MCPcopy
hub / github.com/python-pillow/Pillow / getpixel

Method getpixel

src/PIL/Image.py:1752–1765  ·  view source on GitHub ↗

Returns the pixel value at a given position. :param xy: The coordinate, given as (x, y). See :ref:`coordinate-system`. :returns: The pixel value. If the image is a multi-layer image, this method returns a tuple.

(
        self, xy: tuple[int, int] | list[int]
    )

Source from the content-addressed store, hash-verified

1750 del self.info["transparency"]
1751
1752 def getpixel(
1753 self, xy: tuple[int, int] | list[int]
1754 ) -> float | tuple[int, ...] | None:
1755 """
1756 Returns the pixel value at a given position.
1757
1758 :param xy: The coordinate, given as (x, y). See
1759 :ref:`coordinate-system`.
1760 :returns: The pixel value. If the image is a multi-layer image,
1761 this method returns a tuple.
1762 """
1763
1764 self.load()
1765 return self.im.getpixel(tuple(xy))
1766
1767 def getprojection(self) -> tuple[list[int], list[int]]:
1768 """

Callers 15

test_blur_accuracyFunction · 0.80
gpFunction · 0.80
test_basicFunction · 0.80
test_layersFunction · 0.80
test_l_mode_transparencyFunction · 0.80
test_transparent_disposeFunction · 0.80

Calls 1

loadMethod · 0.95

Tested by 15

test_blur_accuracyFunction · 0.64
gpFunction · 0.64
test_basicFunction · 0.64
test_layersFunction · 0.64
test_l_mode_transparencyFunction · 0.64
test_transparent_disposeFunction · 0.64