Each output pixel is the sum of the source pixels under the kernel window, weighted by the kernel's own values, then divided by the kernel's normalizing factor:
out(x,y) = Σᵢ Σⱼ src(x+i, y+j) · kernel(i,j) / divisor
Sobel kernels approximate the image gradient — Sobel X responds to vertical edges (fast change left↔right), Sobel Y to horizontal edges, and the magnitude √(Gx²+Gy²) highlights edges of any orientation. Gaussian and box kernels average neighbors together (blur); Laplacian and sharpen use a negative-neighbor/positive-center pattern to emphasize or invert local contrast. Border pixels reuse the nearest in-bounds value (edge-replicate padding) so the kernel window never reads outside the grid.
- Source pane — the pixel grid being scanned; the highlighted box is the current kernel window.
- Output pane — the convolution result, revealed pixel by pixel as the scan sweeps row by row (unrevealed pixels stay dark).
- Live computation — the exact 3×3/5×5 neighborhood and kernel values multiplied together to produce the current output pixel.