title: predicting own image with model trained with MNIST dataset
body: <p>I trained a model with the keras mnist dataset for handwriting digit recognition and it has an accuracy of 98%. But when it comes to my own image, the performance is poor. I suppose it has something to do with the preprocessing of my own image. 
  here's how I try to convert the image to 28*28 size.</p>
  
  <pre><code>image = Image.open(f'screenshots/screenshot0.png').convert('L')
  image = image.resize((28,28), Image.ANTIALIAS)
  data = np.asarray(image)/255.0
  </code></pre>
  
  <p>And I found that the color of the image changes after the conversion </p>
  
  <p><a href="https://i.stack.imgur.com/NmrEY.png" rel="nofollow noreferrer">here's the original image</a></p>
  
  <p><a href="https://i.stack.imgur.com/SxXF5.png" rel="nofollow noreferrer">image after resize</a></p>
  
  <p>You can see the white color turns gray after transformation, I wonder if this is the reason for the bad performance? </p>