<jupyter_start><jupyter_text>![rocket](data/src/rocket.jpg)![lena](data/src/lena.jpg)<jupyter_code>im1.paste(im2)
im1.save('data/dst/rocket_pillow_paste.jpg', quality=95)<jupyter_output><empty_output><jupyter_text>![rocket_pillow_paste](data/dst/rocket_pillow_paste.jpg)<jupyter_code>im1 = Image.open('data/src/rocket.jpg')
im2 = Image.open('data/src/lena.jpg')
back_im = im1.copy()
back_im.paste(im2)
back_im.save('data/dst/rocket_pillow_paste.jpg', quality=95)
back_im = im1.copy()
back_im.paste(im2, (100, 50))
back_im.save('data/dst/rocket_pillow_paste_pos.jpg', quality=95)<jupyter_output><empty_output><jupyter_text>![rocket_pillow_paste_pos](data/dst/rocket_pillow_paste_pos.jpg)<jupyter_code>back_im = im1.copy()
back_im.paste(im2, (400, 100))
back_im.save('data/dst/rocket_pillow_paste_out.jpg', quality=95)<jupyter_output><empty_output><jupyter_text>![rocket_pillow_paste_out](data/dst/rocket_pillow_paste_out.jpg)<jupyter_code>mask_im = Image.new("L", im2.size, 0)
draw = ImageDraw.Draw(mask_im)
draw.ellipse((140, 50, 260, 170), fill=255)
mask_im.save('data/dst/mask_circle.jpg', quality=95)

back_im = im1.copy()
back_im.paste(im2, (0, 0), mask_im)
back_im.save('data/dst/rocket_pillow_paste_mask_circle.jpg', quality=95)<jupyter_output><empty_output><jupyter_text>![rocket_pillow_paste_mask_circle](data/dst/rocket_pillow_paste_mask_circle.jpg)<jupyter_code>mask_im_blur = mask_im.filter(ImageFilter.GaussianBlur(10))
mask_im_blur.save('data/dst/mask_circle_blur.jpg', quality=95)

back_im = im1.copy()
back_im.paste(im2, (0, 0), mask_im_blur)
back_im.save('data/dst/rocket_pillow_paste_mask_circle_blur.jpg', quality=95)<jupyter_output><empty_output><jupyter_text>![rocket_pillow_paste_mask_circle_blur](data/dst/rocket_pillow_paste_mask_circle_blur.jpg)<jupyter_code>mask_im = Image.open('data/src/horse.png').resize(im2.size).convert('L')

back_im = im1.copy()
back_im.paste(im2, (100, 50), mask_im)
back_im.save('data/dst/rocket_pillow_paste_mask_horse.jpg', quality=95)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1635282457879088, 'fraction_numerical': 0.036669970267591674, 'mean_word_length': 10.876470588235295, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '214593', 'license': 'MIT', 'n_tokens_mistral': 965, 'n_tokens_neox': 880, 'n_words': 64, 'path': 'notebook/pillow_paste.ipynb', 'repo_name': 'puyopop/python-snippets', 'size': '2018'}