PIL Library
Explore the basics of the PIL library for image processing. Learn to load images, convert them to different modes like RGBA, resize using Lanczos filtering, and apply optional filters. Understand how these steps prepare image data effectively for machine learning models.
We'll cover the following...
Chapter Goals:
- Learn the basics of the
PILmodule - Use
PILto load an image and return its resized pixel data
A. PIL module
While we can do large scale image processing in TensorFlow, the PIL module (from Pillow) allows us to do more fine-grained image processing. In this Lab we will demonstrate basic resizing and filtering as an introduction to PIL. However, the library also has many more utility functions for advanced image processing and analysis. Documentation and extended examples using the PIL module can be found here.
The PIL module has a submodule called Image, which is the main module used for image processing. With it, we ...