Week 5 • Thursday

Block 47: Image Basics with Pillow

Open, inspect, and transform images programmatically.

Concepts

Code Examples

See exercise below.

Exercise

Open an image, print its size and mode, create a thumbnail, save as PNG. Convert an RGB image to grayscale.

Homework

What does img.mode tell you? What is the difference between 'RGB', 'L', and 'RGBA'?