May-25-2023, 11:14 PM
(May-20-2023, 03:19 PM)SpongeB0B Wrote: Apparently PIL has been discontinued in 2011It's Pillow just that it use PIL in import for backward compaltity.
(May-20-2023, 03:19 PM)SpongeB0B Wrote: Pillow afraid me a little because it have a lot of dependency and seem not lightweight.. ?It's lightweight and can do all task you listed.
Example.
>>> from PIL import Image >>> >>> img = Image.open('forest.png') >>> img.get_format_mimetype() 'image/png' >>> Image.MIME[img.format] 'image/png' # Cropping >>> left = 155 ... top = 65 ... right = 360 ... bottom = 270 >>> cr = img.crop((left, top, right, bottom)) >>> cr.show()For metadata look at Edit Your Photos’ EXIF Data with Python