Yes, there is.
import numpy as np
size = (6, 4)
center = (3, 2)
img_xy = np.array([[(x, y) for x in range(size[0])] for y in range(size[1])])
img = np.sum((img_xy - center) ** 2, axis=2) ** 0.5
print('\nPlan1:\n', img)
img = np.linalg.norm(img_xy - center, axis=2)
print('\nPlan2:\n', img)
You will get this:
Plan1:
[[3.60555128 2.82842712 2.23606798 2. 2.23606798 2.82842712]
[3.16227766 2.23606798 1.41421356 1. 1.41421356 2.23606798]
[3. 2. 1. 0. 1. 2. ]
[3.16227766 2.23606798 1.41421356 1. 1.41421356 2.23606798]]
Plan2:
[[3.60555128 2.82842712 2.23606798 2. 2.23606798 2.82842712]
[3.16227766 2.23606798 1.41421356 1. 1.41421356 2.23606798]
[3. 2. 1. 0. 1. 2. ]
[3.16227766 2.23606798 1.41421356 1. 1.41421356 2.23606798]]
If you have any question, you could ask me.