Sliding Gaussian Blur Kernel on a Grayscale Image
Inspired by this animation?
Gaussian Blur Kernel Sliding Animation
Overview
An animation that visualizes a 3Γ3 Gaussian blur kernel moving across a grayscale image. For each position the weighted sum of the underlying pixel values is shown, highlighting the contribution of each kernel element, and the resulting blurred pixel value is displayed. A dark background with a grid is used, kernel cells are colored cyan, the summed result highlighted in yellow, and a short Python/NumPy code snippet is shown in a side panel.
Phases
| # | Phase Name | Duration | Description |
|---|---|---|---|
| 1 | Setup & Overview | ~3s | The dark background appears, a small 5Γ5 grayscale image grid is drawn (pixel values shown as light gray squares). The 3Γ3 Gaussian kernel (cyan squares) is placed at the topβleft corner, and the code panel (yellow background) fades in on the right side. |
| 2 | First Convolution Step | ~4s | The kernel slides to the first central position. Each overlapping pixel lights up, the corresponding kernel weight (displayed as a small number inside the cyan cell) multiplies the pixel value, and arrows illustrate the multiplication. The weighted contributions are summed (shown as a running total in the caption area) and the resulting blurred pixel (yellow square) is placed in the output location. |
| 3 | Sliding Across Image | ~8s | The kernel moves stepβbyβstep across the image (leftβtoβright, topβtoβbottom). For each step the same weightedβsum visualisation repeats, with the previous output pixel staying on the image to build the blurred result. The code panel stays static. |
| 4 | Final Result & Wrapβup | ~3s | After the kernel reaches the last position, the full blurred image is highlighted, and a brief highlight of the line blurred = convolve2d(image, kernel, mode='same') in the code panel is shown. The scene fades out. |
Layout
βββββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββββββββ
β β β
β MAIN (image & β CODE PANEL β
β moving kernel) β (Python/NumPy) β
β β β
βββββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββ€
β Caption / running sum (small footer)β β
βββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββ
Area Descriptions
| Area | Content | Notes |
|---|---|---|
| Main | Grayscale image grid, cyanβcolored 3Γ3 Gaussian kernel, yellow highlighted output pixel, arrows and small numeric weights inside kernel cells. | Primary visual focus; occupies ~70β―% of width. |
| Code Panel | Short Python/NumPy snippet illustrating the kernel definition and convolution call. Background colored darkβyellow for contrast. | Fixed width on the right; no animation inside except occasional highlight. |
| Caption | Small text line showing the current weightedβsum expression, e.g., Ξ£ wα΅’Β·pα΅’ = 123. |
Appears at bottom band; updates each step. |
Notes
- Assumptions: Image size 5Γ5 for clarity; pixel values are arbitrary grayscale intensities (0β255) displayed as light gray squares. Kernel values are the standard Gaussian . Code snippet limited to ~4 lines.
- Colors: background #111111, grid lines cyan, kernel cells cyan fill, output pixel yellow fill, code panel background #222200.
- No additional text objects beyond the caption and code panel; all mathematical relationships are shown visually.
- All timing is approximate; total animation length ~18β―seconds, suitable for clear pedagogical pacing.
- The entire animation fits within a single Manim
Sceneclass.
Created By
Description
The animation shows a 3 by 3 Gaussian blur kernel moving across a small 5 by 5 grayscale image. Each step highlights the overlapping pixels, displays the kernel weights, multiplies them, and sums the contributions to produce a blurred pixel shown in yellow. A side panel presents the Python NumPy code defining the kernel and performing the convolution. The caption updates with the current weighted sum, and the final blurred image is revealed at the end.
Created At
Nov 8, 2026, 06:19 AM
Duration
0:35