It's exactly like a sheet of graph paper, with each x,y coordinate corresponding to an intersection between two lines. The pixels themselves are the squares those lines form. So those coordinates aren't to the pixels themselves, but the corners of each pixel. A line of 10 pixels, if counted, will indeed span 0-9, but if you map out the coordinates, you'll see the left two corners of the first pixel will be (0, 0) and (0, 1), while the right side of the last pixel will be (10, 0), (10, 1).