Similar to 1D convolution, a convolution operation consists of an input, an output, and a kernel.

Here, the kernel is what we use to scan across the data. However, unlike in 1D convolution, we perform the scanning in a two-dimensional plane.

The scanning path typically follows a zigzag pattern. First, we place the kernel over the top-left corner.

Calculate the weighted sum and placed the result in the first position of the output.

Then go one step right and do the same thing.

Return to the leftmost position, move down one unit, repeat the same calculation, and record the result.

Move one unit to the right and perform the calculation to obtain the final output. At this point, the convolution computation is complete because moving further down would go out of bounds.