import numpy as np
# https://numpy.org/doc/stable/reference/generated/numpy.pad.html
image = np.ones((2,2), dtype=int)
padded_image = np.pad(image, 1, dtype=int, mode='constant')
print(padded_image)
# [[0 0 0 0]
# [0 1 1 0]
# [0 1 1 0]
# [0 0 0 0]]
result = np.zeros(b.shape)
# actually you can also use result = np.zeros_like(b)
# but that also copies the dtype not only the shape