Reputation: 572
Say I use this code
img = Image.new('RGB', (500,500), "white")
Is the maximum of the created area 499 or 500? I understand that the minimum is 0 but I can not find documentation on if the 500 in this case would be inclusive or exclusive.
Upvotes: 1
Views: 70
Reputation: 2559
For Image.new(mode, size, color)
, size
is given as a (width, height)-tuple, in pixels.
You can confirm this by checking the pixels of an image with img.getdata()
:
img = Image.new('RGB', (500,500), "white")
pixels = list(img.getdata())
len(pixels)
250000
So yes, you get 500 * 500 pixels with your example.
Upvotes: 2