Fundamental techniques for manipulating and enhancing digital images
Now that we understand how images are formed, it's time to manipulate them. Image processing provides the tools to enhance, filter, and transform images.
What is this chapter about? We cover the fundamental operations that transform pixel values—from simple brightness adjustments to sophisticated filtering using convolution. These are the building blocks used in every computer vision pipeline.
Why does this matter? Before any high-level analysis, images usually need preprocessing:
How the topics connect: We start with point operators that transform each pixel independently—simple but powerful. Then linear filtering introduces convolution, which considers neighborhoods of pixels. We explore the frequency domain where convolution becomes multiplication, enabling efficient processing. Finally, histogram analysis provides tools for contrast enhancement and image comparison.
Click any topic to jump in
Per-pixel transforms, gamma correction, and histograms — operations that don't depend on neighbors.
RGB to grayscale, HSV conversion, and color matrices — changing color representations.
Linear and non-linear approaches
Convolution, separable filters, and Gaussian blur — the workhorse of image processing.
Median, bilateral, and morphological filters — edge-preserving operations that convolution can't do.
Frequency analysis and spatial warping
DFT and the convolution theorem — understanding images in the frequency domain.
Affine, bilinear interpolation, and homography — warping images to new coordinate systems.
Point operators are the simplest image transformations—each output pixel depends only on the corresponding input pixel. Despite their simplicity, they're incredibly useful for adjusting brightness, contrast, and applying tone curves.
These operations are also blazingly fast since pixels can be processed in parallel with no dependencies.
A point-wise operation that adjusts pixel intensities independently:
Used for basic image enhancement, exposure correction, and normalizing images before processing. The transformation is linear because output is a linear function of input.
The linear point operator is a scalar affine map applied independently to each pixel. In vector terms, if the image is a vector , then is an element-wise affine transform that shifts the mean by and scales the variance by . Contrast stretching is the special case that maps onto via , which is the unique affine map satisfying the two boundary conditions.
An image has pixel values in range [40, 180]. Find and to stretch this to [0, 255].
A non-linear intensity mapping that compensates for display characteristics:
Human vision perceives brightness logarithmically, so gamma correction helps match display output to perceptual expectations. Standard sRGB uses .
Gamma correction applies the power-law nonlinearity , which is a monotonic concave function for and convex for . The sRGB standard uses a piecewise function combining a linear segment near zero with a power law. In information-theoretic terms, gamma encoding allocates more code values to dark tones where human contrast sensitivity is highest, effectively performing a form of perceptual quantization that minimizes visible banding for a fixed bit depth.
A pixel has intensity 100. What is its value after gamma correction with (brightening)?
A frequency distribution showing how many pixels have each intensity value:
Histogram equalization redistributes intensities to achieve a more uniform histogram, automatically enhancing contrast.
The histogram estimates the probability mass function of pixel intensities. Histogram equalization seeks a monotonic mapping such that the output CDF is approximately uniform: where . This is an application of the probability integral transform — for continuous random variables, if , then . The discrete version only approximates uniformity because the CDF is a step function.
A 4×4 grayscale image has values: [0,0,1,1, 0,1,2,2, 1,2,2,3, 2,3,3,3]. Compute its histogram for range [0,3].
An 8-bit grayscale image has pixel values ranging from 50 to 150. You want to stretch this to use the full range [0, 255]. What linear transformation parameters (α, β) should you use?