
# gray scale

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg

image = mpimg.imread('Dem_Monument.png')
plt.subplot(1, 2, 1)
#plt.imshow(image)
gray = np.ndarray(image.shape)
gray2 = np.ndarray(image.shape)

gray[:,:,0] = \
gray[:,:,1] = \
gray[:,:,2] = (image[:,:,0]+image[:,:,1]+image[:,:,2]) / 3 

gray2[:,:,0] = \
gray2[:,:,1] = \
gray2[:,:,2] = ((image[:,:,0]+image[:,:,1]+image[:,:,2]) / 3) - 50


plt.subplot(1, 2, 1)
plt.imshow(gray)
plt.subplot(1, 2, 2)
plt.imshow(gray2)

plt.show()
