Write a Python function to calculate the contrast of a grayscale image using the difference between the maximum and minimum pixel values.
Example:
Input:
img = np.array([[0, 50], [200, 255]])
Output:
255
Reasoning:
The function calculates contrast by finding the difference between the maximum (255) and minimum (0) pixel values in the image, resulting in a contrast of 255.