Created
August 19, 2017 09:04
-
-
Save yongjun823/5cb0d295961d0729b0585a0de7ab1f70 to your computer and use it in GitHub Desktop.
PIL : image resize & draw rectangle
This file contains hidden or 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
| from PIL import Image, ImageDraw | |
| im = Image.open(img_path + filter_files[0]) # path | |
| im = im.resize((img_y_size, img_x_size), 1) | |
| draw = ImageDraw.Draw(im) | |
| draw.rectangle(((0, 0), (100, 100)), outline='red') | |
| im.save('result.jpg', 'JPEG') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment