(self, image)
| 30 | return image |
| 31 | |
| 32 | def save_image(self, image): |
| 33 | save_path = filedialog.asksaveasfilename( |
| 34 | defaultextension="*.png", |
| 35 | title="Save as", |
| 36 | filetypes=[ |
| 37 | ("PNG files", "*.png"), |
| 38 | ("All files", "*.*"), |
| 39 | ], |
| 40 | ) |
| 41 | if save_path: |
| 42 | try: |
| 43 | image.save(save_path) |
| 44 | except Exception: |
| 45 | print("Failed to save image: {e}") |