title: Grayscale .png to numpy array
body: <p>Indeed, this question has been answered many times. However, as I am not allowed to add a comment to an answer due to "too low" reputation, I would like to discuss the solution presented in <a href="https://stackoverflow.com/questions/54182675/convert-grayscale-png-to-rgb-png-image">the most comprehensive answer</a>.</p>
  
  <p>Wouldn't the solution:</p>
  
  <pre><code>from PIL import Image
  import numpy as np
  import matplotlib.pyplot as plt #Used in the comparison below
  
  im = Image.open('file.png').convert('RGB') #Opens a picture in grayscale
  pic = np.array(im)
  im.close()
  </code></pre>
  
  <p>work properly? I am wondering whether unacceptable changes in the quality occur. I have noticed some differences (i.e. black rows at the top in plt.imshow()) when I display the image:</p>
  
  <pre><code>im.show() #Before closing
  plt.imshow(pic)
  </code></pre>
  
  <p>but I don't know whether they are only inevitable consequences of converting to np.array.</p>
  
  <p>PS - If it is important, I would mention that I prepare the image for color quantization (KMeans) and Floyd dithering.</p>
  
  <p>PPS - If you advised me how not to post duplicate question but discuss answers directly - it would be really appreciated.</p>