Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PIL import Image
- fname = input()
- image = Image.open(fname)
- pix = image.load()
- npixels = image.size[0]*image.size[1]
- ncloud = 0
- for x in range(image.size[0]):
- for y in range(image.size[1]):
- col = pix[x,y]
- if col[0] >= 192 and col[1] >= 192 and col[2] >= 192:
- ncloud += 1
- print(ncloud/npixels*100)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement