
Image Processing in Python
Processing raster images with the Pillow library
by Martin McBride
This book is for sale at http://leanpub.com/imageprocessinginpython
This version was published on 2021-08-22
Github: https://github.com/martinmcbride/python-imaging-book-examples
I Bitmap images
1. Introduction to bitmap imaging
1.1 What is a bitmap image?
You might be more familiar with alternative names - raster image, or pixel image. They mean the same thing as bitmap image. They are sometimes also called JPEG images or PNG images, named after specific image file formats.
You probably also know that a bitmap is made up of pixels - they can be thought of as tiny coloured squares that make up the image. They are normally too small to see but become visible if you zoom in too far and the image becomes pixelated.
1.2 Spatial sampling
- A real-world scene has an almost infinite amount of detail.
- A bitmap image has a finite amount of detail.
- If the pixels are very small together, we can’t distinguish the individual, and the image looks similar to the actual scene.
- In practical terms, at a viewing distance of 40 cm, the eye can resolve objects that are about 0.1 mm apart.
- This means that if you wanted to print an image on a page so that the eye couldn’t see the individual pixels, you should aim for a pixel resolution of 10 pixels per mm (about 250 pixels per inch) or better.