A convolutional layer slides one small filter over the image and records an inner product at each position (10.2). Choose an image, a filter, the zero padding P, the stride S and the dilation D, and click (or tap) any output cell to see which input pixels produced it. The feature map has floor((J + 2P − D(M − 1) − 1)/S) + 1 rows. Switch to transposed to run the operation backwards: each input pixel stamps a scaled copy of the filter into a larger output (Figure 10.30).
Numbers are pixel intensities in [0, 1] (input) and the filter responses (output, red positive, blue negative). Padding cells are drawn darker and hold 0. The book's “convolution” (10.2) is a cross-correlation; the mathematical convolution (10.19) flips the filter first, which here only matters for filters that are not symmetric.
code/ch10_convolutional_networks.py (xcorr2d, conv2d_math, conv_transpose2d, out_size); this page reproduces their output number for number.