<jupyter_start><jupyter_text>______Content Copyright by <NAME>  Image Exercise - SolutionIn the folder "Working with Images" (same folder this notebook is located in) there are two images we will be working with:* word_matrix.png* mask.pngThe word_matrix is a .png image that contains a spreadsheet of words with a hidden message in it. Your task is to use the mask.png image to reveal the hidden message inside the word_matrix.png. Keep in mind, you may need to resize the mask.png in order for this to work.This exercise is more open-ended, so we won't guide you with the steps, instead, letting you explore and figure things out on your own as you would in a real world situation. However, if you get stuck, you can always view the solutions video or notebook for guidance. Best of luck!  Import Images<jupyter_code>from PIL import Image
words = Image.open('word_matrix.png')
words
mask = Image.open("mask.png")
mask<jupyter_output><empty_output><jupyter_text>Resize Images to Match<jupyter_code>mask.size
words.size
mask = mask.resize((1015,559))
mask.size<jupyter_output><empty_output><jupyter_text>Add in alpha parameterNow we can't just paste them over, otherwise we won't see what is underneath, we need to add an alpha value.<jupyter_code>mask.putalpha(200)
# links.putalpha(128)
mask
words.paste(mask,(0,0),mask)
words<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07363770250368189, 'fraction_numerical': 0.011045655375552283, 'mean_word_length': 5.597087378640777, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '403941', 'license': 'DOC', 'n_tokens_mistral': 407, 'n_tokens_neox': 391, 'n_words': 174, 'path': 'Complete-Python-3-Bootcamp-master/14-Working-with-Images/02-Image-Exercise-Solution.ipynb', 'repo_name': 'davidMartinVergues/PYTHON', 'size': '1364'}