Unit 1: Fundamental of Image Processing [8 Hours]
Digital Image Processing (DIP) deals with representing images in digital form and processing them using computer-based techniques. This unit builds the foundation of DIP by explaining pixels, image representation, human visual perception, sampling and quantization, color, image file formats, and basic image operations. It also introduces perceptual properties such as brightness, contrast, hue, saturation, and the Mach band effect, which explain how both computers and humans interpret visual information.
Tested Topics
- Basic relationship between pixels — 1x (2023)
- Image operations — 1x (2025)
- Mach band effect — 1x (2023)
- Sampling and Quantization — 1x (2023)
1.1 Image Representation
Definition
An image can be represented mathematically as a two-dimensional function f(x, y), where x and y specify the spatial position and f(x, y) gives the intensity or color value at that position.
A digital image is a rectangular grid of tiny picture elements called pixels. Each pixel stores a numerical value describing how bright or what color that small part of the image should appear.
Detailed Explanation
In mathematical form:
f(x, y) = intensity value at coordinate (x, y)
An ordinary continuous image may contain continuously varying spatial positions and intensity values. A computer cannot directly store infinitely many values. Therefore, the image is converted into a finite grid of discrete positions and discrete intensity or color values.
Pixels and Coordinates
A pixel, short for picture element, is the smallest individually addressable element of a digital image. Every pixel has:
- Spatial coordinates: identify where the pixel is located.
- Intensity or color value: describes the visual value stored at that location.
For example, a small grayscale image may be represented as:
| x = 0 | x = 1 | x = 2 | |
|---|---|---|---|
| y = 0 | 20 | 80 | 150 |
| y = 1 | 35 | 120 | 200 |
| y = 2 | 50 | 170 | 255 |
Here, a low value represents a darker pixel and a high value represents a brighter pixel if the image uses the common 8-bit grayscale range from 0 to 255.
Major Forms of Digital Images
- Binary image: each pixel has only two possible values, commonly 0 and 1, representing two states such as black and white.
- Grayscale image: each pixel represents a level of brightness. An 8-bit grayscale image normally provides 256 possible intensity levels.
- Color image: each pixel contains multiple color components. For example, a Red, Green, Blue (RGB) image stores separate red, green, and blue values.
| Image Type | Information Stored per Pixel | Typical Example |
|---|---|---|
| Binary | Two possible states | Scanned text or simple mask |
| Grayscale | Brightness level | Medical X-ray image |
| Color | Multiple color components | Digital photograph |
Image as a Matrix
A digital image can also be treated as a matrix:
f(x, y) → matrix of pixel values
If an image has M rows and N columns, it contains:
Total pixels = M × N
For example, a 1920 × 1080 image contains:
1920 × 1080 = 2,073,600 pixels
Summary
- A digital image is represented as a two-dimensional function f(x, y).
- The coordinates x and y locate a point, while f(x, y) gives its intensity or color.
- A pixel is the smallest individually addressable element of a digital image.
- Digital images can be binary, grayscale, or color images.
- An M × N digital image contains M × N pixels.
Test Yourself
- How is a digital image represented mathematically?
- Differentiate between binary, grayscale, and color images.
Hints:
- Use f(x, y): x and y represent spatial coordinates, while f gives intensity or color at that position.
- Binary has two states; grayscale stores brightness levels; color stores multiple color components for each pixel.
1.2 Basic Relationship Between Pixels
Definition
Basic relationships between pixels describe how pixels are positioned, connected, and measured relative to other pixels in a digital image. Important relationships include neighborhood, adjacency, connectivity, regions, boundaries, and distance.
A pixel does not exist independently from the pixels around it. Processing techniques often need to know which pixels touch each other, which ones belong to the same object, and how far one pixel is from another.
Detailed Explanation
Consider a pixel p located at coordinates (x, y). The pixels surrounding p can be classified according to their positions.
4-Neighbors of a Pixel
The 4-neighbors of p are the pixels immediately above, below, left, and right of it.
N4(p) = {(x − 1, y), (x + 1, y), (x, y − 1), (x, y + 1)}
They can be visualized as:
| (x, y−1) | ||
| (x−1, y) | p(x, y) | (x+1, y) |
| (x, y+1) |
Diagonal Neighbors
The diagonal neighbors lie diagonally around p:
ND(p) = {(x−1, y−1), (x+1, y−1), (x−1, y+1), (x+1, y+1)}
8-Neighbors
The 8-neighbors include both the four direct neighbors and four diagonal neighbors.
N8(p) = N4(p) ∪ ND(p)
Adjacency
Two pixels are adjacent when they are considered neighbors and their intensity values satisfy a specified condition. Let V represent the set of pixel values being considered, such as V = {1} in a binary image.
- 4-adjacency: pixels p and q are adjacent if q belongs to N4(p) and both pixel values belong to V.
- 8-adjacency: pixels p and q are adjacent if q belongs to N8(p) and their values belong to V.
- Mixed adjacency: also called m-adjacency. It allows diagonal adjacency only when the two pixels do not share a common 4-neighbor whose value belongs to V. This avoids ambiguous diagonal connections.
| Relationship | Neighbors Considered | Main Characteristic |
|---|---|---|
| 4-adjacency | Horizontal and vertical | Does not directly connect diagonal pixels |
| 8-adjacency | Horizontal, vertical, and diagonal | Allows all surrounding pixels to connect |
| m-adjacency | 4-neighbors plus restricted diagonals | Reduces ambiguous diagonal connections |
Connectivity and Path
A path from pixel p to pixel q is a sequence of pixels:
p = p0 → p1 → p2 → ... → pn = q
where every consecutive pair is adjacent according to the selected adjacency rule.
Two pixels are connected if a valid path exists between them. Connectivity allows an image-processing system to identify separate objects or components in an image.
Region and Boundary
A region is a connected set of pixels. Pixels belonging to one object can therefore form a region.
The boundary of a region consists of those pixels in the region that have at least one neighboring pixel outside the region.
For example, in a binary image containing a white circle on a black background:
connected white pixels → circle region → outer white pixels touching black pixels → boundary
Distance Measures
Distance measures describe how far apart two pixels are. Let:
p = (x, y) and q = (s, t)
Euclidean distance:
DE(p, q) = √[(x − s)2 + (y − t)2]
City-block distance:
D4(p, q) = |x − s| + |y − t|
Chessboard distance:
D8(p, q) = max(|x − s|, |y − t|)
For p = (2, 3) and q = (5, 7):
- Euclidean distance = √[(2−5)2 + (3−7)2] = √25 = 5
- City-block distance = 3 + 4 = 7
- Chessboard distance = max(3, 4) = 4
Let's Clarify
A city road network helps separate the distance ideas. If movement is allowed only along horizontal and vertical streets, the movement resembles city-block distance. If diagonal movement is also allowed, as a king moves on a chessboard, the distance resembles chessboard distance. Euclidean distance measures the direct straight-line separation.
Summary
- 4-neighbors are the horizontal and vertical pixels surrounding a pixel.
- 8-neighbors contain the 4-neighbors plus the four diagonal neighbors.
- Adjacency defines when neighboring pixels are considered connected.
- A connected collection of pixels forms a region, while its outer pixels form the boundary.
- Euclidean, city-block, and chessboard measures provide different definitions of pixel distance.
Test Yourself
- Differentiate between 4-adjacency, 8-adjacency, and m-adjacency.
- Define basic relationship between pixels. (2023)
Hints:
- 4-adjacency considers horizontal and vertical neighbors; 8-adjacency also includes diagonals; m-adjacency restricts diagonal connections to remove ambiguity.
- Explain neighborhood, adjacency, connectivity, regions and boundaries, and pixel distance measures.
1.3 Elements of a Digital Image Processing System
Definition
A Digital Image Processing system is a collection of hardware and software components that acquire an image, convert it into digital form, process it, store it, display it, and communicate or print the result.
The complete system is more than an image-processing program. A camera or scanner first captures the scene, hardware converts it into data, software processes that data, and other devices store or present the output.
Detailed Explanation
A typical DIP system contains the following elements.
1. Image Sensing and Acquisition
An image sensor receives energy reflected or emitted from a scene and converts it into an electrical signal. A digitizer then converts the signal into numerical pixel values.
Scene → optical system → sensor → electrical signal → digitization → digital image
Examples include digital cameras, scanners, medical imaging sensors, and satellite sensors.
2. Specialized Image Processing Hardware
Specialized hardware performs operations that require high speed. It may handle image acquisition, filtering, compression, graphics processing, or other low-level numerical operations.
3. Computer
A general-purpose computer controls the overall system and executes processing tasks. Its processor and memory determine how efficiently large images and complex algorithms can be handled.
4. Image Processing Software
Image processing software contains algorithms used for operations such as enhancement, restoration, compression, analysis, segmentation, and visualization.
5. Mass Storage
Digital images can require significant storage capacity. Storage is commonly needed at three levels:
- Short-term storage: temporary memory used while an image is being processed.
- Online storage: disks or solid-state storage holding actively used images.
- Archival storage: long-term storage for large image collections.
6. Image Display
Displays convert digital pixel values into visible output. Monitors are used to examine the original image, intermediate processing results, and final output.
7. Hardcopy Devices
Hardcopy devices create permanent physical output. Examples include printers and photographic output systems.
8. Networking
Networking allows digital images to be transmitted between systems. This is essential when acquisition, processing, storage, and interpretation occur at different locations.

Typical Data Flow
Image acquisition → digitization → computer processing → storage → display or hardcopy → transmission when required
Summary
- A DIP system combines sensing, computation, storage, output, and communication components.
- Image acquisition converts information from a real scene into digital pixel values.
- Computers and specialized hardware execute image-processing operations.
- Software supplies the algorithms used to modify and analyze images.
- Storage, displays, hardcopy devices, and networks manage the processed results.
Test Yourself
- List and explain the major elements of a digital image processing system.
- Describe the flow of an image from acquisition to final output.
Hints:
- Cover image sensing, specialized hardware, computer, software, storage, display, hardcopy, and networking.
- Scene → sensor → digitization → processing → storage → display, print, or transmission.
1.4 Elements of Visual Perception and Simple Image Formation Model
Definition
Visual perception is the process by which the human visual system receives light and interprets it as shapes, brightness, colors, edges, and objects. A simple image formation model describes the observed image intensity as the interaction between illumination falling on an object and the amount of that illumination reflected by the object.
An image does not depend only on the object being viewed. It also depends on the light illuminating the object and on how much light the object's surface reflects toward the observer or imaging sensor.
Detailed Explanation
Human Visual System
The human eye receives visible light and focuses it onto the retina. Important structures include:
- Cornea: the transparent front surface that begins focusing incoming light.
- Iris: controls the size of the pupil.
- Pupil: opening through which light enters the eye.
- Lens: changes shape to focus light on the retina.
- Retina: light-sensitive surface where the optical image is formed.
- Optic nerve: carries visual signals from the retina toward the brain.
Rods and Cones
The retina contains two important types of photoreceptor cells:
| Feature | Rods | Cones |
|---|---|---|
| Main role | Vision under low illumination | Color and fine-detail vision |
| Color sensitivity | Do not provide normal color discrimination | Responsible for color perception |
| Light sensitivity | High | Lower than rods |
| Detail | Lower spatial detail | Higher spatial detail |
Brightness Adaptation and Discrimination
The human eye can operate across a very wide range of illumination levels, but it cannot distinguish all of those levels simultaneously. It adapts to the general brightness of the current environment. This ability is known as brightness adaptation.
Brightness discrimination is the ability to notice a small difference between two nearby intensity levels. The visible difference depends partly on the surrounding brightness, which is why identical pixel values can appear different when placed on different backgrounds.
Simple Image Formation Model
A common image formation model is:
f(x, y) = i(x, y) × r(x, y)
where:
- f(x, y): observed image intensity at position (x, y).
- i(x, y): illumination falling on the scene.
- r(x, y): reflectance of the object at that position.
Illumination is non-negative:
0 < i(x, y) < ∞
Reflectance represents the fraction of incident illumination reflected by the surface:
0 ≤ r(x, y) ≤ 1
A value of r close to 0 represents a surface that reflects little light, while a value close to 1 represents a highly reflective surface.
Worked Example
Suppose the illumination at a point is 200 units and the surface reflectance is 0.4.
f(x, y) = i(x, y) × r(x, y)
f(x, y) = 200 × 0.4 = 80
The resulting image intensity at that position is therefore 80 units under the model.
Let's Clarify
A white shirt looks much brighter under sunlight than in a dark room even though the shirt itself has not changed. The shirt's surface determines reflectance, while the surrounding light determines illumination. The image reaching the eye depends on both quantities together.
Summary
- Visual perception converts incoming light into perceived brightness, color, shape, and detail.
- The retina contains rods for sensitive low-light vision and cones for color and fine detail.
- Brightness adaptation allows the visual system to operate under different overall illumination levels.
- The simple image model is f(x, y) = i(x, y)r(x, y).
- Illumination describes incident light, while reflectance describes the fraction returned by the object.
Test Yourself
- Explain the simple image formation model and define its components.
- Differentiate between rods and cones in human visual perception.
- If illumination is 150 units and reflectance is 0.6, find the resulting image intensity.
Hints:
- Use f(x, y) = i(x, y)r(x, y); i represents illumination and r represents surface reflectance.
- Rods are highly sensitive and support low-light vision; cones provide color and finer spatial detail.
- f = 150 × 0.6 = 90 units.
1.5 Sampling and Quantization
Definition
Sampling converts the spatial coordinates of a continuous image into discrete positions, while quantization converts continuous intensity or color values into a finite number of discrete levels.
Sampling answers, “How many locations of the image will be recorded?” Quantization answers, “How many possible values can each recorded location have?” Both are necessary to represent an image digitally.
Detailed Explanation
This topic builds directly on 1.1 Image Representation. A continuous image must be made discrete in two ways before a computer can store it.
Continuous image → sampling of coordinates → quantization of values → digital image
Sampling
Sampling divides the continuous x-y image plane into a finite grid.
If an image is sampled into M rows and N columns, the resulting image contains:
Number of pixels = M × N
Increasing the number of samples normally increases spatial resolution, meaning that finer spatial details can be represented.
Effect of Sampling
- High sampling rate: more pixels represent the scene, allowing finer detail.
- Low sampling rate: fewer pixels represent the scene, so small details may disappear or become distorted.
If the sampling rate is too low for the spatial detail present in an image, an artifact called aliasing can occur. Fine patterns may then appear as false patterns or jagged structures.
Quantization
Quantization assigns each sampled point to one of a finite number of permitted intensity or color levels.
If each pixel uses k bits, the number of available levels is:
L = 2k
Therefore:
- 1 bit → 2 levels
- 2 bits → 4 levels
- 4 bits → 16 levels
- 8 bits → 256 levels
- 9 bits → 512 levels
Increasing the number of quantization levels improves intensity resolution because smaller differences in brightness or color can be represented.
Effect of Quantization
- More levels: smoother intensity transitions and finer tonal representation.
- Fewer levels: visible bands or abrupt changes may appear in areas that should change gradually.

| Basis | Sampling | Quantization |
|---|---|---|
| What becomes discrete? | Spatial coordinates | Intensity or color values |
| Controls | Number of pixels | Number of possible values per pixel |
| Main resolution | Spatial resolution | Intensity resolution |
| If insufficient | Loss of detail and possible aliasing | Coarse tonal levels and banding |
Image Storage Requirement
For an M × N image having L possible values per pixel:
k = log2L
where k is the number of bits required for one pixel.
The total uncompressed image data size is:
B = M × N × k bits
where:
- M: number of rows.
- N: number of columns.
- k: bits per pixel.
- B: total number of bits.
Worked Example: 2023 Question
An image is represented by 512 possible colors and has dimensions 1028 × 1028. Assuming each pixel directly stores one of the 512 possible values:
Step 1: Find bits per pixel.
512 = 29
Therefore:
k = 9 bits per pixel
Step 2: Find total number of pixels.
1028 × 1028 = 1,056,784 pixels
Step 3: Find total storage in bits.
B = 1,056,784 × 9 = 9,511,056 bits
Step 4: Convert to bytes.
9,511,056 ÷ 8 = 1,188,882 bytes
This is approximately 1.13 mebibytes of raw pixel data when 1 mebibyte = 1,048,576 bytes. File headers, metadata, padding, and compression are not included.
Common Mistake
Sampling and quantization are different operations. Sampling does not determine how many intensity levels exist. It determines the number and positions of pixels. Quantization determines how many numerical intensity or color values those pixels can represent.
Summary
- Sampling discretizes the spatial coordinates of an image.
- Quantization discretizes the intensity or color values assigned to sampled positions.
- Spatial resolution depends mainly on the number of samples.
- If L levels are available, each pixel requires k = log2L bits when L is a power of two.
- An M × N image using k bits per pixel requires M × N × k raw bits.
Test Yourself
- Differentiate between sampling and quantization.
- Explain sampling and quantization with reference to digital image processing, further also calculate the size of image which is represented by 512 colors with x and y coordinates given as 1028*1028. (2023)
Hints:
- Sampling makes spatial coordinates discrete; quantization makes intensity or color values discrete.
- 512 = 29, so 9 bits/pixel. Pixels = 1028 × 1028 = 1,056,784. Size = 9,511,056 bits = 1,188,882 bytes, approximately 1.13 MiB of raw image data.
1.6 Color Fundamentals and Models
Definition
Color is a visual sensation produced when light of different spectral compositions stimulates the human visual system. A color model is a mathematical system for representing colors as numerical components.
A computer cannot store “red” or “blue” as human sensations. It represents a color using numbers, such as the amounts of red, green, and blue required to reproduce it.
Detailed Explanation
Fundamentals of Color
Visible color is associated with the portion of electromagnetic radiation that the human eye can perceive. The color perceived from an object depends on the spectral properties of the illumination, the object's interaction with that light, and the human visual system.
Three useful perceptual properties are:
- Hue: identifies the dominant perceived color family, such as red, green, or blue.
- Saturation: describes the purity or vividness of a color.
- Brightness or intensity: describes the perceived amount of light.
Additive and Subtractive Color
Additive color creates colors by combining emitted light. The primary components are red, green, and blue. Combining all three at high intensity produces white.
Subtractive color describes systems in which pigments or inks absorb portions of incident light. Printing commonly uses cyan, magenta, yellow, and black components.
| Property | Additive Color | Subtractive Color |
|---|---|---|
| Primary components | Red, green, blue | Cyan, magenta, yellow |
| Typical medium | Emitted light | Ink or pigment |
| Common application | Displays and cameras | Printing |
| Combination tendency | Adding light moves toward white | Adding ideal pigments moves toward black |
Red, Green, Blue Color Model
The Red, Green, Blue (RGB) color model represents each color using red, green, and blue components. It is widely used in cameras, monitors, phones, and computer graphics.
In an 8-bit-per-channel representation, each component commonly ranges from 0 to 255.
- (255, 0, 0) → red
- (0, 255, 0) → green
- (0, 0, 255) → blue
- (255, 255, 255) → white
- (0, 0, 0) → black
Cyan, Magenta, Yellow and Black Color Model
The Cyan, Magenta, Yellow, Black (CMYK) color model is mainly used in printing. Cyan, magenta, and yellow inks absorb different components of visible light. A separate black component is used because practical printing benefits from a dedicated dark ink for strong blacks, fine detail, and economical reproduction.
For normalized ideal RGB and Cyan, Magenta, Yellow (CMY) values:
C = 1 − R
M = 1 − G
Y = 1 − B
Hue, Saturation, Intensity Color Model
The Hue, Saturation, Intensity (HSI) color model describes color in terms that are closer to human perception.
- Hue: basic color type.
- Saturation: purity of the color.
- Intensity: overall light level.
Separating intensity from chromatic information can be useful in image analysis because brightness may be processed independently from color characteristics.
Hue, Saturation, Value Color Model
The Hue, Saturation, Value (HSV) color model also separates the color type and purity from a brightness-like component called value. It is commonly used in color selection interfaces and various computer-vision operations.
Luminance-Chrominance Models
Some color systems separate brightness-related information from color-difference information. For example, the YCbCr representation uses a luminance-related component Y and two chrominance components. Such separation is widely useful in digital image and video representation.

| Color Model | Main Components | Typical Use |
|---|---|---|
| RGB | Red, green, blue | Displays, cameras, graphics |
| CMYK | Cyan, magenta, yellow, black | Printing |
| HSI | Hue, saturation, intensity | Image analysis and perceptual processing |
| HSV | Hue, saturation, value | Color selection and computer vision |
| YCbCr | Luminance-related and chrominance components | Digital image and video representation |
Let's Clarify
RGB describes a color by asking how much red, green, and blue light is required. HSI and HSV reorganize the same idea around visual properties: what color it is, how pure that color is, and how bright it appears. The underlying color has not changed; only its numerical description has.
Summary
- Color is produced by the interaction of light with the visual system.
- A color model provides numerical coordinates for representing colors.
- RGB is an additive model widely used by digital displays and imaging devices.
- CMYK is a subtractive model associated primarily with printing.
- HSI and HSV separate hue and saturation from an intensity or value component.
Test Yourself
- Explain the RGB and CMYK color models and state their major applications.
- Why are HSI or HSV representations useful when describing color?
- Differentiate between additive and subtractive color systems.
Hints:
- RGB uses emitted red, green, and blue light; CMYK uses printing inks based on cyan, magenta, yellow, and black.
- They describe color using perceptual components such as hue, saturation, and brightness-related information.
- Additive systems combine emitted light and move toward white; subtractive systems use materials that absorb portions of incident light.
1.7 File Formats
Definition
An image file format defines how digital image data and related information are organized and stored in a file.
Two files may display the same picture while storing it differently. One format may prioritize small size, another exact reproduction, another transparency, and another animation or professional editing.
Detailed Explanation
An image format may specify:
- How pixel values are arranged.
- How colors are represented.
- Whether compression is used.
- Whether transparency is supported.
- What metadata can be stored.
- Whether multiple frames or images can exist in one file.
Lossless and Lossy Compression
Lossless compression reduces file size while allowing the original encoded image data to be reconstructed exactly.
Lossy compression reduces file size by permanently discarding some information considered less important for the intended reproduction.
| Feature | Lossless | Lossy |
|---|---|---|
| Data after decompression | Reconstructed exactly | Some information is permanently lost |
| Typical file size | Usually larger than aggressive lossy compression | Can be substantially smaller |
| Suitable for | Graphics, text, diagrams, editing, archival cases | Photographs and size-sensitive delivery |
Common Image File Formats
| Format | Main Characteristics | Common Use |
|---|---|---|
| Joint Photographic Experts Group (JPEG) | Typically uses lossy compression; effective for continuous-tone photographs; no normal alpha transparency support | Photographs, websites, cameras |
| Portable Network Graphics (PNG) | Lossless compression; supports alpha transparency | Web graphics, screenshots, diagrams |
| Graphics Interchange Format (GIF) | Indexed color with a palette of up to 256 colors per frame; supports animation | Simple graphics and short animations |
| Tagged Image File Format (TIFF) | Flexible format that can store high-quality images using different encoding and compression options | Publishing, scanning, archival workflows |
| Bitmap (BMP) | Commonly stores raster pixel data with little or no compression in basic forms | Simple Windows bitmap storage and interchange |
| WebP | Supports lossy and lossless compression as well as transparency | Web image delivery |
Choosing a File Format
The appropriate format depends on the image and the required output:
- Photographic image with small delivery size → JPEG or a modern compressed format such as WebP.
- Graphic requiring transparency or exact preservation → PNG.
- Simple frame-based web animation → GIF.
- High-quality publishing or archival workflow → TIFF when its features fit the workflow.
Common Mistake
Image dimensions and file size are not the same thing. Two 1920 × 1080 images can occupy very different amounts of storage because their bit depth, file format, compression method, and image content can differ.
Summary
- An image file format defines how image data and metadata are stored.
- Lossless compression reconstructs the encoded data exactly, while lossy compression permanently discards some information.
- JPEG is widely suited to photographic imagery where compact storage is desired.
- PNG provides lossless compression and transparency support.
- GIF, TIFF, BMP, and WebP serve different needs involving animation, quality, compatibility, or web delivery.
Test Yourself
- Differentiate between lossy and lossless image compression.
- Compare JPEG, PNG, GIF, and TIFF image formats.
- Why can two images with identical dimensions have different file sizes?
Hints:
- Lossless permits exact reconstruction; lossy permanently removes some information to obtain greater size reduction.
- Compare compression, transparency, animation, image quality, and common applications.
- Bit depth, compression, format, metadata, and image content can differ even when pixel dimensions match.
1.8 Image Operations
Definition
Image operations are mathematical or logical transformations applied to one or more images to modify pixel values, spatial positions, appearance, or image information.
An operation may change every pixel independently, use nearby pixels to calculate a new value, combine two images, or move pixels to new locations.
Detailed Explanation
An image operation normally accepts one or more input images and produces an output image:
Input image or images → processing operation → output image
Important classes of image operations include point operations, arithmetic operations, logical operations, neighborhood operations, and geometric operations.
1. Point Operations
In a point operation, each output pixel depends only on the corresponding input pixel.
g(x, y) = T[f(x, y)]
where T is a transformation applied independently to each pixel.
Examples include:
- Brightness adjustment.
- Contrast modification.
- Thresholding.
- Image negative transformation.
For brightness addition:
g(x, y) = f(x, y) + c
where c is a constant.
2. Arithmetic Operations
Arithmetic operations mathematically combine pixel values.
- Addition: combines information from images or increases pixel values.
- Subtraction: reveals differences between images.
- Multiplication: can scale intensity values or apply masks.
- Division: may be used for ratio-based processing and normalization.
For two images f and h:
g(x, y) = f(x, y) − h(x, y)
Image subtraction is useful in change detection. If two images of the same scene are aligned, unchanged areas tend to produce small differences while changed areas produce larger values.
3. Logical Operations
Logical operations manipulate pixels according to bitwise or binary logic. Common operations include:
- AND: retains information where selected conditions are true in both inputs.
- OR: combines regions satisfying either input condition.
- Exclusive OR (XOR): highlights differing logical states.
- NOT: complements binary values.
These operations are particularly useful with binary images and masks.
4. Neighborhood Operations
In a neighborhood operation, an output pixel is determined from the input pixel together with surrounding pixels.
A small matrix called a kernel, mask, or filter is moved across the image.
Typical uses include:
- Smoothing noise.
- Sharpening details.
- Detecting edges.
The neighborhood relationships described in 1.2 Basic Relationship Between Pixels provide the spatial basis for these operations.
5. Geometric Operations
Geometric operations modify the spatial positions of pixels.
Common operations are:
- Translation: moves an image horizontally or vertically.
- Rotation: turns an image through an angle.
- Scaling: increases or decreases image dimensions.
- Reflection: flips the image across an axis.
- Shearing: slants the image geometry.
Geometric transformations frequently require interpolation because transformed coordinates may fall between existing pixel positions. Interpolation estimates the new pixel value from nearby known values.
6. Operations Based on Number of Input Images
| Operation Type | Input | Example |
|---|---|---|
| Unary | One image | Negative, brightness adjustment |
| Binary | Two images | Addition, subtraction, AND |
| Multiple-image | More than two images | Image averaging or multi-image combination |
Worked Walkthrough
Suppose a grayscale pixel has value 100 and a brightness operation adds 40:
g = f + c = 100 + 40 = 140
The transformed pixel becomes brighter because its intensity has increased from 100 to 140.
If another pixel already has value 240, adding 40 mathematically gives 280. In an 8-bit image restricted to 0–255, an implementation using clipping would store the maximum permitted value:
min(255, 240 + 40) = 255
Let's Clarify
Point processing resembles changing each student's mark using one fixed rule, such as adding five marks to every score. Neighborhood processing is different: the new value for one student would depend on nearby students' values as well. Geometric processing changes where the values are placed rather than only changing the values themselves.
Summary
- Image operations transform pixel values, pixel positions, or relationships between images.
- Point operations calculate each output pixel from its corresponding input pixel.
- Arithmetic and logical operations can combine two or more images.
- Neighborhood operations use surrounding pixels for filtering, smoothing, sharpening, or edge processing.
- Geometric operations alter spatial coordinates through translation, scaling, rotation, reflection, or shearing.
Test Yourself
- Differentiate between point, neighborhood, and geometric image operations.
- What are different image operations? Explain. (2025)
Hints:
- Point: corresponding pixel only. Neighborhood: surrounding pixels also influence the result. Geometric: changes pixel coordinates or image shape.
- Explain point, arithmetic, logical, neighborhood, and geometric operations with representative examples.
1.9 Brightness
Definition
Brightness is the visual attribute associated with how light or dark an image or image region appears.
When pixel intensity values are raised, the image generally appears brighter. When they are lowered, it generally appears darker, subject to the image representation and display conditions.
Detailed Explanation
Brightness is related to intensity but should be understood as a perceptual property. The numerical intensity stored in an image contributes to perceived brightness, while human perception and surrounding illumination also affect the final visual impression.
Brightness Transformation
A basic digital brightness adjustment is:
g(x, y) = f(x, y) + c
where:
- f(x, y): original pixel value.
- g(x, y): transformed pixel value.
- c: brightness adjustment constant.
If c is positive, pixel values increase. If c is negative, they decrease.
For an 8-bit image:
f = 80, c = 30 → g = 110
When a result exceeds the permitted range, it is commonly clipped to the allowed maximum or minimum.
Brightness and Illumination
Brightness also connects to 1.4 Visual Perception and Simple Image Formation. Increasing illumination can make the recorded or perceived image brighter even when the object's reflectance remains unchanged.
Summary
- Brightness describes how light or dark an image appears.
- Higher image intensity values generally produce a brighter appearance.
- A basic brightness operation adds a constant to pixel values.
- Perceived brightness also depends on surrounding conditions and human visual perception.
1.10 Contrast
Definition
Contrast is the degree of difference between the brightness or intensity levels present in an image.
An image has stronger contrast when dark regions and bright regions are clearly separated. When most values occupy a narrow intensity range, the image often appears flat or washed out.
Detailed Explanation
Contrast determines how easily differences between image regions can be distinguished.
For a basic intensity range:
Intensity range = maximum intensity − minimum intensity
A wider useful spread of pixel values can provide stronger tonal separation, although perceived contrast also depends on spatial context.
Contrast Scaling
A simple linear operation can be written as:
g(x, y) = a × f(x, y)
where a is a scaling constant.
- If a > 1, differences from low to high values can be increased, subject to clipping and the chosen transformation.
- If 0 < a < 1, the numerical intensity range is compressed.
Brightness vs. Contrast
| Property | Brightness | Contrast |
|---|---|---|
| Describes | Overall light or dark appearance | Difference among intensity levels |
| Basic transformation | Add or subtract a value | Expand or compress intensity differences |
| Main visual effect | Shifts general lightness | Changes separation between tones |
Common Mistake
Increasing brightness is not the same as increasing contrast. Brightness can shift most pixel values upward together, while contrast changes the separation between different intensity levels.
Summary
- Contrast measures the distinction between different intensity or brightness levels.
- High contrast creates stronger separation between light and dark regions.
- Low contrast places many visible tones within a relatively narrow range.
- Brightness shifts overall intensity, while contrast changes differences between intensities.
1.11 Hue
Definition
Hue is the color attribute that distinguishes basic color families such as red, green, yellow, and blue.
Hue answers the everyday question, “What color is it?” It describes the type of color rather than how bright or how vivid that color appears.
Detailed Explanation
Hue builds on 1.6 Color Fundamentals and Models. In representations such as HSI and HSV, hue is stored separately from saturation and the brightness-related component.
For example:
- A dark red and a bright red can share a similar hue.
- A pale red and a vivid red can also share a similar hue while having different saturation.
This separation is useful because processing can select or modify a color family without treating brightness as the same property.
Summary
- Hue identifies the basic perceived color family.
- Red, green, blue, and yellow represent examples of different hues.
- Hue is conceptually different from brightness and saturation.
- HSI and HSV explicitly represent hue as a separate color component.
1.12 Saturation
Definition
Saturation describes the purity, vividness, or colorfulness of a hue compared with a less colorful or more neutral appearance.
A highly saturated red looks strong and vivid. Reducing saturation makes the color appear increasingly dull or grayish without necessarily changing its basic hue.
Detailed Explanation
Saturation builds on 1.11 Hue. Hue identifies the basic color, while saturation indicates how strongly that color is expressed.
Consider two red objects:
- A vivid red traffic sign has relatively high saturation.
- A pale, grayish red surface has lower saturation.
Hue, Saturation, and Brightness
| Property | Question It Answers | Example Change |
|---|---|---|
| Hue | What basic color is it? | Red → green |
| Saturation | How vivid or pure is the color? | Vivid red → grayish red |
| Brightness | How light or dark does it appear? | Dark red → brighter red |
Summary
- Saturation describes the strength or purity of a perceived color.
- Highly saturated colors appear vivid and strongly colored.
- Low-saturation colors appear more neutral or grayish.
- Saturation is different from both hue and brightness.
1.13 Mach Band Effect
Definition
The Mach band effect is a visual illusion in which the human eye perceives exaggerated bright and dark bands near the boundary between regions of different brightness, even though those extra bands are not physically present in the image.
When two areas with different intensity levels meet, the boundary can appear stronger than the actual intensity values would suggest. A narrow bright strip may seem to appear on the brighter side and a narrow dark strip on the darker side.
Detailed Explanation
The Mach band effect demonstrates that human vision does not perceive every intensity value independently. The appearance of one region is influenced by neighboring regions.
How the Effect Appears
Consider several adjacent vertical regions arranged from dark to bright, with each region itself having a constant intensity.
dark region → medium-dark region → medium region → bright region
The physical intensity within each individual region may remain constant. However, near the boundaries:
- The side next to a darker region may appear slightly brighter.
- The side next to a brighter region may appear slightly darker.
The observer therefore perceives narrow bands that do not correspond to actual extra intensity bands in the image.
Relation to Edge Perception
The visual system is highly responsive to local changes in intensity. This enhances the perception of boundaries and helps separate neighboring surfaces. The Mach band effect is one demonstration of this local contrast behavior.
It also connects to 1.10 Contrast: perceived contrast near a boundary can be greater than the numerical contrast suggested by examining each region independently.
Let's Clarify
Imagine placing a medium-gray card beside a darker card and then beside a lighter card. The gray itself has not changed, but it can appear lighter against the dark background and darker against the light background. Mach bands are a stronger edge-related example of this contextual behavior of human vision.
Common Mistake
The visible bands in the Mach band effect are not necessarily actual bright and dark stripes stored in the image. They are produced by visual perception near intensity transitions.
Summary
- The Mach band effect is a human visual perception phenomenon near brightness boundaries.
- The eye perceives exaggerated light and dark bands even when those bands are not physically present.
- The effect occurs because perceived intensity depends partly on neighboring intensities.
- Mach bands illustrate the visual system's strong sensitivity to local contrast and edges.
Test Yourself
- Why can the perceived brightness of a region depend on neighboring regions?
- Write short notes on: b) Mach Band effect. (2023)
Hints:
- Human brightness perception is contextual; local intensity differences influence how each region appears.
- Define the Mach band effect, describe the apparent bright and dark bands at intensity boundaries, and relate it to local contrast and edge perception.
Exam Questions
- What are different image operations? Explain. (2025)
- Explain sampling and quantization with reference to digital image processing, further also calculate the size of image which is represented by 512 colors with x and y coordinates given as 1028*1028. (2023)
- Write short notes on: b) Mach Band effect. (2023)
- Define basic relationship between pixels. (2023)
Whole Chapter Summary
Image Representation
A digital image is a two-dimensional array of pixels represented by f(x, y). Coordinates identify pixel positions, while stored values represent intensity or color.
Basic Relationship Between Pixels
Pixels are related through neighborhood, adjacency, connectivity, regions, boundaries, and distance. The main neighborhood systems are 4-neighborhood, diagonal neighborhood, and 8-neighborhood.
Elements of a Digital Image Processing System
A complete DIP system includes image acquisition, processing hardware, computer, software, storage, displays, hardcopy devices, and networking. Together they convert a scene into useful digital output.
Elements of Visual Perception and Simple Image Formation
Human perception depends on the eye, retina, rods, cones, and adaptation to light. A basic image can be modeled by f(x, y) = i(x, y)r(x, y), combining illumination and surface reflectance.
Sampling and Quantization
Sampling discretizes spatial positions and determines the pixel grid. Quantization discretizes intensity or color values and determines the number of permitted levels.
Color Fundamentals and Models
Color is represented numerically using models such as RGB, CMYK, HSI, HSV, and YCbCr. Different models organize color information for display, printing, perception-oriented processing, or digital representation.
File Formats
Image formats determine how pixel data and associated information are stored. JPEG, PNG, GIF, TIFF, BMP, and WebP differ in compression, transparency, animation, quality, and intended use.
Image Operations
Image operations transform pixel values or positions. Major categories include point, arithmetic, logical, neighborhood, and geometric operations.
Brightness
Brightness describes perceived lightness or darkness. A basic digital brightness adjustment increases or decreases pixel intensity values.
Contrast
Contrast describes the difference among brightness or intensity levels. Stronger useful differences make regions and details easier to distinguish.
Hue
Hue identifies the basic color family, such as red, green, or blue. It is represented separately from brightness and saturation in several perceptual color models.
Saturation
Saturation describes how vivid or pure a color appears. High saturation produces strong color, while low saturation moves the appearance toward neutral gray.
Mach Band Effect
Mach bands are perceived bright and dark bands near intensity boundaries that are not necessarily present in the actual image values. They demonstrate the contextual nature of human brightness and edge perception.
Key Formulas and Points Sheet
| Formula or Rule | Meaning |
|---|---|
| f(x, y) | Digital image function; x and y are spatial coordinates and f gives the image value. |
| Total pixels = M × N | Number of pixels in an M-row by N-column image. |
| f(x, y) = i(x, y)r(x, y) | Simple image formation model combining illumination and reflectance. |
| 0 ≤ r(x, y) ≤ 1 | Reflectance is represented as a fraction from zero to one. |
| L = 2k | Number of possible levels when each pixel uses k bits. |
| k = log2L | Bits needed to represent L levels when L is a power of two. |
| B = M × N × k | Raw image storage requirement in bits. |
| N8(p) = N4(p) ∪ ND(p) | 8-neighborhood combines direct and diagonal neighbors. |
| DE(p,q) = √[(x−s)2+(y−t)2] | Euclidean distance between pixels. |
| D4(p,q) = |x−s|+|y−t| | City-block distance. |
| D8(p,q) = max(|x−s|,|y−t|) | Chessboard distance. |
| g(x,y) = T[f(x,y)] | General point-processing transformation. |
| g(x,y) = f(x,y)+c | Basic brightness adjustment. |
| g(x,y) = a f(x,y) | Basic intensity scaling transformation. |
| C = 1−R, M = 1−G, Y = 1−B | Ideal normalized conversion relationship between RGB and CMY components. |
Last-Minute Revision Sheet
| Concept | Trigger Phrase | Recall Cue |
|---|---|---|
| Digital image | f(x, y) | coordinates + pixel value |
| Pixel | picture element | smallest addressable image unit |
| 4-neighbors | up, down, left, right | N4 |
| 8-neighbors | 4-neighbors + diagonals | N8 |
| Adjacency | valid neighboring pixels | 4, 8, m |
| Connectivity | valid path exists | connected component |
| Image formation | illumination × reflectance | f = ir |
| Sampling | where to measure | spatial coordinates → pixels |
| Quantization | what value to assign | finite intensity levels |
| Levels | L = 2k | k bits per pixel |
| Image size | M × N × k | raw bits |
| RGB | additive light | red + green + blue |
| CMYK | printing | cyan + magenta + yellow + black |
| Hue | which color? | red, green, blue... |
| Saturation | how vivid? | pure ↔ grayish |
| Brightness | light or dark | intensity level |
| Contrast | difference between tones | separation of intensities |
| Point operation | one pixel → one output pixel | g = T(f) |
| Neighborhood operation | nearby pixels matter | filter or kernel |
| Geometric operation | coordinates change | rotate, scale, translate |
| Mach band effect | false-looking bands at boundaries | local contrast perception |
| JPEG | photographic compression | typically lossy |
| PNG | lossless + transparency | graphics and screenshots |
| GIF | indexed color + animation | up to 256 colors per frame |


