Image Processing in Python
$4.99
Minimum price
$4.99
Suggested price

Image Processing in Python

Processing raster images with the Pillow library

About the Book

This is an early draft of the book, which will be available by end of July 2021. Purchase now for just $5, and upgrade to the final version for free when it is available.

About the Author

Martin McBride
Martin McBride

Martin McBride is a software developer, specialising in computer graphics, sound, and mathematical programming. He has been writing code since the 1980s in a wide variety of languages from assembler through to C++, Java and Python. He writes for PythonInformer.com and is the author of Functional Programming in Python. He is interested in generative art and works on the generativepy open source project.

Table of Contents

  •  
    • Preface
      • Who is this book for?
      • About the author
      • Keep in touch
    • Introduction
      • Versions
  • I Bitmap images
    • 1 Introduction to bitmap imaging
      • 1.1 What is a bitmap image?
      • 1.2 Spatial sampling
      • 1.3 Colour representation
      • 1.4 File formats
      • 1.5 Vector images
    • 2 Computer colour
      • 2.1 Visible light
        • 2.1.1 Frequency and wavelength
      • 2.2 What is colour?
        • 2.2.1 Non-spectral colours
      • 2.3 How we see colour
      • 2.4 The RGB colour model
        • 2.4.1 Displaying colour
        • 2.4.2 Representing RGB colours as a percentage
        • 2.4.3 Floating point representation
        • 2.4.4 Byte value representation
      • 2.5 Colour resolution
      • 2.6 Greyscale colour model
      • 2.7 The CMYK colour model
        • 2.7.1 The K component
      • 2.8 HSL/HSB colour models
      • 2.9 HSL variants
      • 2.10 Perceptual colour models
      • 2.11 Colour management
    • 3 Bitmap data
      • 3.1 Data layout
      • 3.2 8-bit per channel images
        • 3.2.1 24-bit RGB
        • 3.2.2 32-bit CMYK
        • 3.2.3 8-bit greyscale
        • 3.2.4 32-bit RGBA
      • 3.3 Bitmap data with fewer levels
        • 3.3.1 8-bit RGB
        • 3.3.2 16-bit RGB
        • 3.3.3 Dithering
      • 3.4 Bilevel images
      • 3.5 Bitmap data with more levels
      • 3.6 Palette based images
        • 3.6.1 Images with more than 256 colours
      • 3.7 Handling transparency
        • 3.7.1 Alpha channel
        • 3.7.2 Transparent palette entry
        • 3.7.3 Transparent colour
  • II Pillow library
    • 4 Introduction to Pillow
      • 4.1 Pillow and PIL
      • 4.2 Installing Pillow
      • 4.3 Main features of Pillow
    • 5 Basic imaging
      • 5.1 The Image class
      • 5.2 Creating and displaying an image
      • 5.3 Saving an image
      • 5.4 Handling colours
        • 5.4.1 Converting strings to colours
      • 5.5 Creating images
      • 5.6 Opening an image
      • 5.7 Image processing
      • 5.8 Rotating an image
      • 5.9 Creating a thumbnail
      • 5.10 Image modes
    • 6 ImageOps module
      • 6.1 Image resizing functions
        • 6.1.1 expand
        • 6.1.2 crop
        • 6.1.3 scale
        • 6.1.4 pad
        • 6.1.5 fit
      • 6.2 Image transformation functions
        • 6.2.1 flip
        • 6.2.2 mirror
        • 6.2.3 exif-transpose
      • 6.3 Colour effects
        • 6.3.1 grayscale
      • 6.4 colorize
      • 6.5 invert
      • 6.6 posterize
      • 6.7 solarize
      • 6.8 Image adjustment
      • 6.9 Deforming images
    • 7 Image attributes and statistics
      • 7.1 Attributes
        • 7.1.1 File size
        • 7.1.2 File name
        • 7.1.3 File format
        • 7.1.4 Mode and bands
        • 7.1.5 Palette
        • 7.1.6 Info
        • 7.1.7 Animation
      • 7.2 Palette data
      • 7.3 Tiff tags
      • 7.4 Jpeg presets
      • 7.5 Image statistics
    • 8 Enhancing and filtering images
      • 8.1 ImageEnhance
        • 8.1.1 Brightness
        • 8.1.2 Contrast
        • 8.1.3 Color
        • 8.1.4 Sharpness
      • 8.2 ImageFilter
      • 8.3 Predefined filters
      • 8.4 Parameterised filters
        • 8.4.1 Blurring functions
        • 8.4.2 Unsharp masking
        • 8.4.3 Ranking and averaging filters
      • 8.5 Defining your own filters
        • 8.5.1 Color3DLUT
        • 8.5.2 Kernel
        • 8.5.3 Filter
        • 8.5.4 MultibandFilter
  • III Reference
    • 9 Pillow colour representation
      • 9.1 Hexadecimal colour specifiers
      • 9.2 RGB functions
      • 9.3 HSL functions
      • 9.4 HSV functions
      • 9.5 Named colours
      • 9.6 Example
    • More books from this author
      • Numpy Recipes
      • Computer Graphics in Python with Pycairo
      • Functional Programming in Python

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Do Well. Do Good.

Authors have earned$10,444,831writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF, EPUB and/or MOBI files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub