In cellular automata, the von Neumann neighborhood (or 4-neighborhood) is classically defined on a two-dimensional square lattice and is composed of a central cell and its four adjacent cells.
This neighbourhood can be used to define the notion of 4-connected pixels in computer graphics.
[4] An extension of the simple von Neumann neighborhood described above is to take the set of points at a Manhattan distance of r > 1.
This results in a diamond-shaped region (shown for r = 2 in the illustration).
These are called von Neumann neighborhoods of range or extent r. The number of cells in a 2-dimensional von Neumann neighborhood of range r can be expressed as