When I try to plot a gray-scale image, sometimes the image is normalized by the min and max pixels in the image. Is there anyway to specify an absolute scale from 0 to 255.
We can see from the example below the pixel 240 is plotted very differently.
import numpy as np
from matplotlib import pyplot as plt
x = np.array([
[255,255,255],
[255,255, 255],
[255, 240, 0]
])
plt.imshow(x, cmap = "gray")
x = np.array([
[255,255,255],
[255,255, 255],
[255, 240, 240]
])
plt.imshow(x, cmap = "gray")