A project to review the Tkinter module and create an application for watermarking pictures with Pillow in Python.
The user can upload an image, type some text that should be displayed as a watermark and choose the position, font, color, and size of the text.
Before displaying the new image, it’s resized to fit the window.
When the Preview Button is pressed, and a picture was uploaded the program gets hold of the text and position. The position is then “translated” into coordinates on the resized picture. In the last step the size, color and font are saved and used to change the text_containter
- Canvas object.
If no picture was uploaded the user will be asked to upload one.
When the user wants to download the picture, the final watermark with the original size coordinates is created and drawn with the Pillow’s ImageDraw. Finally, the new filename gets the watermarked_
-prefix and the user is asked to provide a location.