Attribute defines the various property of an object, element or file. In the image, attribute refers to the size, filename, format or mode, etc. of the image.
Image used is:
Instances of the Image class have the following attributes:
PIL.Image.filename: The filename or path of the source file. Only images created with the factory function open have a filename attribute. If the input is a file-like object, the filename attribute is set to an empty string.
Syntax: PIL.Image.filename Type: py:class: string
PIL.Image.format: The file format of the source file. For images created by the library itself (via a factory function, or by running a method on an existing image), this attribute is set to None.
Syntax: PIL.Image.format Type: string or None
PIL.Image.mode: Image mode. This is a string specifying the pixel format used by the image. Typical values are “1”, “L”, “RGB”, or “CMYK.” See Modes for a full list.
Syntax: PIL.Image.mode Type: string
PIL.Image.size: Image size, in pixels. The size is given as a 2-tuple (width, height).
Syntax: PIL.Image.size Type: (width, height)
- Dynamic Attributes in Python
- How to Get a List of Class Attributes in Python?
- Class and Instance Attributes in Python
- Accessing Attributes and Methods in Python
- Python PIL Attributes | Image.height method
- Python PIL Attributes | Image.width Method
- Filtering Images based on size attributes in Python
- wxPython | Get default attributes of Radio Box
- wxPython - Get Default Attributes of StaticText
- Python - Read blob object in python using wand library
- MySQL-Connector-Python module in Python
- Python | Index of Non-Zero elements in Python list
- twitter-text-python (ttp) module - Python
- Reading Python File-Like Objects from C | Python
- Important differences between Python 2.x and Python 3.x with examples
- Python | Convert list to Python array
- Python | Merge Python key values to list
- Python | PRAW - Python Reddit API Wrapper
- Python | Set 4 (Dictionary, Keywords in Python)
- Python | Add Logging to a Python Script
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : nidhi_biet