Created
February 27, 2019 05:43
-
-
Save sleepless-se/2a34fbc72de0532c7d639bbb1b23b186 to your computer and use it in GitHub Desktop.
make_maks by PIL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_mask(size,start_width,start_height,end_width,end_height): | |
mask = Image.new("L",(size,size),0) | |
draw = ImageDraw.Draw(mask) | |
draw.rectangle((start_width,start_height,end_width,end_height), fill=255) | |
print('mask',mask.size) | |
return mask |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment