(self, image, logo, position=(0, 0))
| 16 | return image |
| 17 | |
| 18 | def add_logo(self, image, logo, position=(0, 0)): |
| 19 | if logo.mode != "RGBA": |
| 20 | logo = logo.convert("RGBA") |
| 21 | if image.mode != "RGBA": |
| 22 | image = image.convert("RGBA") |
| 23 | |
| 24 | if (position[0] + logo.width > image.width) or ( |
| 25 | position[1] + logo.height > image.height |
| 26 | ): |
| 27 | CTkMessagebox(title="Logo position", message="Logo position out of bounds.") |
| 28 | |
| 29 | image.paste(logo, position, mask=logo) |
| 30 | return image |
| 31 | |
| 32 | def save_image(self, image): |
| 33 | save_path = filedialog.asksaveasfilename( |
no test coverage detected