1 year ago
#73770

user17982376
How to detect non-transparent shape corner of a png image with Python?
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
python-2.7
png
pixel
0 Answers
Your Answer