Pixel Neighborhoods
Pixels have have neighbors. But what that neighbor is depends on the definition!
There are three common definitions of 'neighbors' of a pixel. They're called N4, N8, and ND.
Hover your cursor over the grids. The pixels that light up are the neighbors in the labelled definition.
N4
N8
ND