- PIL Home
- Python Image Library Intro
- Python Image Library Setup
- Python Image Library Basics
- Python Image Library Hierarchy
- Python Image Library Modules
- Python ImageColor Module
- Python ImageDraw Module
- Python ImageStat Module
- Python ImageTK Module
- Python ImageFile Module
- Python ImageFilter Module
- Python ImageGrab Module
- Python ImageMath Module
- Python - Loading Image
- Python - Rotating Image
- Python - Blurring Image
- Python - Converting Image
- Python - Cropping Image
- Python - Image Thumbnails
- Python - Text on Images
- Python - Multiple Image Copies
- Python - Saving Image As PDF
- Python - Saving Screenshot
- Python - Resizing Image
- Python - Adding Watermark
- Python Image Library Resources
- Python - Quick Guide
- Python - Useful Resources
- Python - Discussion
Python Image Library Basics
Image: A image composed of individual pixels of various colors. Also called raster graphics image, bitmap image ,bitmap or raster image.
Pixel: Every image comprises of some amount of pixels. Pixel is the smallest unit information that brings up a picture. If the image contains more number of pixels, the visibility of the image will be in much better way.Each pixel stores information in 3 components, known as RGB or CMYK
Band: Band is a set of values. RGB images.RGB format images have 3 bands. CMYK images have 4 bands. Grayscale images have 1 band. We can get the bands by using the function getbands().
Modes: The mode tells about the way how the image is filled with colors.
Below are the few modes.
RGB: The mode tells about the way how the image is filled with colors.
Below are the few modes.
| Mode | Band | Description |
| RGB | 3 | Red-Green-Blue color |
| CMYK | 4 | Cyan-Magenta-yellow-Black color |
greyscale images: Grey scale image is an image whose each pixel can be black,white or a shade of gray.Grayscale can be defined as a range of shades of gray without colour.Many image editing programs allow you to convert a color image to black and white, or grayscale. This process removes all color information, leaving only the luminance of each pixel. RGBA: RGBA stands for Red Green Blue Alpha.Any Color contains the combination of RGB.Alpha channel allows us to specify an opacity value for a colour.It defines the transparency of that pixel.
Croping: Cropping means just cutting out a small rectangular part of the image.Cropping an image or photo generally means to remove a part of the image that can be cutting some of the image from the left,right,top,bottom.
Resizing: Image Resizing is a process to change the size at which the image will print without changing the number of pixels in the image instead the pixels are printed further apart or closer together.
thumbnail: Thumbnail image is a reduced form of an image.Instead of loading the larger image directly thumbnails can be used for faster access of the image.
Image Formats: There are different formats of image like jpg, bmp, gif. Like this Pillow library supports 30 different formats but all the formats cannot be modified as we do for jpg or gif. Few formats are only readable and few are writable.
jpg: JPEG is a standardised image compression mechanism. JPG format internally will compress image data to the least possible sections of image.JPG is a common choice for use on the Web because it is compressed.
gif: GIF stands for Graphics Interchange Format.GIF format is limited to 256 colors and is a lossless compression file format, a common choice for use on the Web. GIF is a best option for storing simple lines, text, and iconic graphics at a small file size.
png: PNG stands for Portable Network Graphics.PNG format can be called the alternative option to the gif format. PNG is the advanced version of GIF format.The PNG format do not lose quality while modifying or editing the image.