title: Keras ImageDataGenerator messing up with grey images, how to correctly augment greyscale image?
body: <p>I am analysing 16bit grey scale images.
  After uploading greyscale image, everything looks fine.</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  img = plt.imread('example_image.tif')
  plt.imshow(img)
  plt.show()
  </code></pre>
  
  <h1>Or one can also do</h1>
  
  <pre><code>import cv2
  img = cv2.imread('example_image.tif', -cv2.IMREAD_ANYDEPTH)
  img1 = np.expand_dims(img, axis=2)
  img2 = np.reshape(img1,[1,696,520,1])
  plt.imshow(img)
  plt.show()
  </code></pre>
  
  <p>When I checked my augmented images, they looks distorted. What am I doing wrong?</p>
  
  <pre><code>img1 = np.expand_dims(img, axis=2)
  img2 = np.reshape(img1,[1,696,520,1])
  from keras.preprocessing.image import ImageDataGenerator
  datagen = ImageDataGenerator(
      rescale=1. / 4095,
      shear_range=0.2,
      zoom_range=0.2,
      horizontal_flip=True)
  
  i=0
  for batch in datagen.flow(img2, batch_size=1,
                            save_to_dir='C:/image_analysis', save_prefix='grey_check_', save_format='tif'):
      i += 1
      if i &gt; 20:
          break
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/YMV1u.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YMV1u.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/M2G68.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M2G68.png" alt="enter image description here"></a></p>