Definition
The positional framework used to address individual pixels in a digital image, where the origin (0, 0) is located at the top-left corner.
Why It Matters
In the digital world, “gravity” pulls from the top-left; applying standard Cartesian math to a screen will result in inverted images and broken GUI logic every time. This coordinate system is the fundamental translation layer between human geometric intuition and the physical refresh patterns of hardware displays.
Core Concepts
# (0,0) ----> +X
# |
# |
# v
# +Y
from PIL import Image
im = Image.new('RGBA', (100, 100), 'white')
# Top-left corner pixel
im.putpixel((0, 0), (255, 0, 0))
- Y-Axis Inversion: Unlike Cartesian coordinates in mathematics, the y-coordinate increases going downward.
- X-Axis Consistency: The x-coordinate increases from left to right, consistent with traditional math.
- Pixel Addressing: Every pixel is a discrete unit at an integer
(x, y)location. - The “Reading Order” Model: This system mirrors how computers read data from memory buffers and how Western text is read (top-to-bottom, left-to-right).