Treat an image as numerical data throughout this section: identify what a pixel or feature actually represents, what mathematical or logical transformation is being applied to it, and what specific information that operation enhances, removes, detects, or compresses. A small worked matrix, or a simple before/after example, is almost always the easiest route to genuinely understanding an operation, rather than trying to memorize its description in words alone.
A. The Related Fields, and How Images Are Represented
Image processing transforms or analyzes images directly; computer graphics creates images from underlying models (the reverse direction, essentially); computer vision tries to infer meaning from images (what is actually in the scene); artificial intelligence is the broader field encompassing many different methods for producing intelligent behaviour, of which computer vision is one application area. These fields overlap substantially in practice but have genuinely different primary goals. Example: removing noise from a photograph is image processing; generating a 3D scene from a model is graphics; identifying pedestrians within a video frame is computer vision — and an AI classification method might then be used downstream to categorize whatever computer vision has already detected.
A sensor captures physical light or energy and converts it into digital data; a digital image is represented as a grid of picture elements (pixels), each carrying a numerical intensity or colour value. Sampling determines spatial resolution (how many pixels represent the image); quantization determines how many distinct intensity levels each pixel can take. Too little sampling loses genuine spatial detail; too few quantization levels can cause visible banding (abrupt, artificial-looking steps between what should be smooth intensity gradations). Example: an 8-bit grayscale pixel can represent 256 distinct intensity levels, numbered 0 through 255 in the common convention — this single number, bit depth, directly determines both storage size and the smoothness of intensity transitions an image can represent.
B. Transformations, Histograms, and Colour
Geometric transformations change an image’s position or shape: translation moves it, scaling resizes it, rotation turns it, and shear slants it — all of these are typically expressed as transformation matrices applied systematically to pixel coordinates. A histogram summarizes the distribution of intensity values across an entire image, and reading one tells you a great deal about an image’s overall contrast and brightness at a glance. Enhancement techniques make useful detail more visible: contrast adjustment changes how spread out the intensity values are, smoothing reduces noise (and unfortunately some genuine detail along with it), and sharpening emphasizes transitions and edges. Example: a dark, low-contrast image typically has histogram values crowded into a narrow range near the dark end; stretching or equalizing that histogram can spread those values out and increase visible contrast, under suitable conditions. Enhancement is explicitly application-dependent — there is no single “correct” enhancement, only one that makes an image more useful for a specific stated purpose.
Grayscale images store intensity only, with no colour information; colour images encode multiple colour components together. A colour model is simply a coordinate system for describing colours precisely and unambiguously. RGB (red, green, blue) is additive and common in displays, which combine light; CMYK (cyan, magenta, yellow, key/black) is subtractive and common in printing, which combines pigments; HSI (hue, saturation, intensity) separates the perceptual concepts of colour, purity, and brightness from each other explicitly. Example: the exact same visible colour can have entirely different numeric coordinates in RGB versus HSI, precisely because the two models organize and describe colour information in fundamentally different ways. Restoration tries to recover a degraded image using an explicit mathematical model of what specifically caused the degradation — this is a genuinely different goal from enhancement, which improves an image’s subjective usefulness without necessarily being based on any formal degradation model at all.
C. Morphology, Segmentation, and Compression
Morphological operations transform shapes in binary or grayscale images using a structuring element (a small, predetermined shape pattern that is systematically compared against the image). Erosion shrinks foreground regions; dilation expands them; opening (erosion followed by dilation) and closing (dilation followed by erosion) combine these two basic operations to achieve more specific effects, such as removing small noise spots or filling small gaps. Example: closing can fill small gaps within a foreground region, smoothing out its outline, while edge detection instead highlights the actual borders between different regions in an image. Segmentation divides an image into meaningful regions — a genuinely more ambitious goal than merely detecting individual edges or points, since segmentation aims to produce complete, labeled regions rather than isolated boundary pixels.
Compression reduces the number of bits needed to store or transmit an image, by removing redundancy and, for lossy methods specifically, by discarding some information judged to be less perceptually important. Lossless compression allows the exact original image to be reconstructed perfectly; lossy compression trades away some fidelity in exchange for a much smaller file size, and which trade-off is acceptable depends entirely on the specific application. Example: a medical or scientific imaging workflow may require strict, lossless preservation of every detail, while a web thumbnail image can typically tolerate substantial lossy compression without any meaningful loss of usefulness — there is no single compression approach that is universally correct across every application.
Image Processing key takeaways: an image is fundamentally numerical data, and every operation on it is best understood as a specific transformation applied to that underlying data. Sampling and quantization together determine an image’s spatial resolution and intensity resolution, respectively. Enhancement improves subjective usefulness for a stated purpose; restoration recovers an image using an explicit degradation model — these are genuinely different goals even though both aim to “improve” an image. Morphological operations (erosion, dilation, opening, closing) manipulate shape; segmentation produces complete labeled regions, a more ambitious goal than edge detection alone. Compression always trades some combination of fidelity and file size, and the acceptable trade-off point is entirely application-dependent.
