Python Forum
image manipulation (cropping and MetaData)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
image manipulation (cropping and MetaData)
#4
(May-20-2023, 03:19 PM)SpongeB0B Wrote: Apparently PIL has been discontinued in 2011
It'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
Reply


Messages In This Thread
RE: image manipulation (cropping and MetaData) - by snippsat - May-25-2023, 11:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  AttributeError: 'function' object has no attribute 'metadata 3lnyn0 5 5,013 Mar-28-2022, 04:42 PM
Last Post: Larz60+
  Adding Language metadata to a PDF programmatically bhargavi22 0 2,015 Aug-17-2020, 12:53 PM
Last Post: bhargavi22
  METADATA Errors millpond 0 2,019 Jul-21-2020, 08:22 AM
Last Post: millpond
  How to sort image files according to a metadata file? Brahmslove 1 3,237 Dec-05-2019, 11:25 PM
Last Post: scidam
  Parse the data in XML metadata field klllmmm 2 3,439 Jun-19-2019, 04:24 PM
Last Post: klllmmm
  cropping a picture (always square) Leon 1 2,239 Aug-13-2018, 10:04 AM
Last Post: Leon
  Tiff metadata sudecki 1 26,586 Aug-10-2018, 07:08 AM
Last Post: sudecki
  Video Metadata Question malonn 10 9,797 Jul-23-2018, 04:04 PM
Last Post: malonn
  Help developing img cropping tool in python lerugray 9 7,081 Dec-20-2017, 08:07 AM
Last Post: Mekire
  image processing and manipulation 3015799 1 3,019 Nov-01-2017, 01:57 PM
Last Post: heiner55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020