Skip to Content
A Concise Introduction to Programming in Python
book

A Concise Introduction to Programming in Python

by Mark J. Johnson
December 2011
Beginner
217 pages
8h
English
Chapman and Hall/CRC
Content preview from A Concise Introduction to Programming in Python
Project: Image Filters
Many common image manipulations can be described as the application of a
filter. An image filter is a square array of coefficients that describes how old
pixel values will be combined to find a new pixel value. Each entry in the array
is a coefficient to be multiplied by the color in that location. The resulting
RGB values are then added together to pro duce the final result. The center
of the filter corresponds to the position of the pixel whose color is currently
being computed.
For example, this is a 3 × 3 filter that takes 0 times the current color (in the
center) plus 1/8 times each of the colors in the surrounding pixels:
1/8 1/8
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Standard Library

Python Standard Library

Fredrik Lundh
Numerical Computing with Python

Numerical Computing with Python

Pratap Dangeti, Allen Yu, Claire Chung, Aldrin Yim

Publisher Resources

ISBN: 9781439896952