I would like to determine the pixels of corner of non-transparent shape of a png image with Python?
Here is the image
. For better understanding the transparent area marked red color as:
Here is my code:
from PIL import Image
img = Image.open('image.png')
columnsize,rowsize=img.size
img = img.convert("RGBA")
for i in range(rowsize):
for j in range(columnsize):
X=img.getpixel((j,i))
print X