
Build a command-line image converter and learn geometric transforms: resize, flip, rotate, and crop, then edge-based cropping, logos and watermarks, and background removal, with pipenv or zip setup.
Open and store image data with Pillow's Image class, then display, convert, and save images using convert.py. Use os module to handle file paths and keep images in same directory.
Explore inspecting image properties with Pillow—size, format, info, and mode (RGB, RGBA)—and use show() to display images for debugging while avoiding lag in batch processing.
Learn how Pillow opens and converts formats such as png, jpeg, gif, eps, and tiff, saves with a chosen extension, and extracts frames from animated gifs.
Build a Python command line tool using argparse and Pillow to convert images by filename and target extension, saving the new file after rgb conversion.
Learn to resize images with Python and the Pillow Image class, preserve aspect ratio during downsampling, convert values to integers for the resize method, and note upscaling causes pixelation.
Use the thumbnail method, a lazy in-place resize, to preserve the 16:9 aspect ratio and never enlarge, unlike resize which can enlarge and returns a new image.
Rotate and flip images with Pillow, using rotate with expand to true to convert 1280 by 720 to 1416 by 1416, and apply 90-degree increments via transpose or flips.
Learn to crop images with Pillow by defining a box. Use the upper left and lower right coordinates, such as (0,0,1920,880), or a centered 200x200 box.
Detect image edges and remove outliers to crop tightly around the object using Pillow's edge detection and edge-based coordinates.
Explore image manipulation with Python and Pillow by using thumbnail to preserve aspect ratio and modify in place, and compare it to resize which can enlarge but may be grainy.
Add a transparent logo to a background image for branding, resizing the logo to about 10% of the image width, then paste it with a mask and 3% padding.
Draw a centered watermark with a rectangle around the text, rotate it diagonally across the image using a new RGBA canvas and a TrueType font.
Center the watermark text by computing image midpoints and text dimensions. Use textsize to obtain text_width and text_height, then adjust text_location with half the widths and a 36-pixel line height.
Set a 50-pixel padding to draw a rectangle around the centered text, deriving x1, y1, x2, y2 from text_location, text_width, and text_height.
Learn to calculate the watermark angle with arctangent using python's math library, or use a quick rotate -30 degrees method to place a diagonal watermark.
Remove a green screen background with python and pillow by converting to rgba, detecting green pixels with thresholds, and making the background transparent, with iterative tweaks to preserve detail.
Explore Pillow's image filters and enhancements, using compare_images to test filters like emboss and blur. Learn to adjust color, contrast, brightness, and sharpness with ImageEnhance and compare_enhancements.
Wrap up the course by leaving a review and sharing your image manipulation projects, from simple edits to an Instagram clone, and reach out in the Q&A.
Pillow is a free and open source library for the Python programming language that allows you to easily create and manipulate images.
In this course, we'll take a hands-on approach to learning the library with several projects:
All of the source code is included with the course, so you can learn by coding along, watching the videos, or refactoring the code to meet your needs.
If you're looking to automate your image editing workflow, expand your knowledge of Python, or are seeking your next creative project, this course is a must for you.