Initial Commit

This commit is contained in:
Michael Pivato
2018-11-19 21:52:30 +10:30
parent d7f7cfe810
commit 2b4f959572
5 changed files with 181 additions and 5 deletions

View File

@@ -0,0 +1,15 @@
from PIL import Image
from PIL import ImageDraw
img = Image.open('/Users/piv/Desktop/IMG_0818.png')
# Create a new image of the cutout.
blkimg = Image.new('1', (img.width, img.height)
blkdraw = ImageDraw.Draw(blkimg)
for i in range(1, img.width):
for j in range(1, img.height):
# getpixel returns tuple (r,g,b,a)
pixel = img.getpixel((i, j))
if (pixel[0]/pixel[1]) > 1.05 and (pixel[0]/pixel[1]) < 4: