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]]