title: Why is that image distorted when using tf.image.resize?
body: <p>I am using Tensorflow 2.4.0 and have the following code:</p>
  <pre><code>import tensorflow as tf
  import numpy as np
  
  import PIL
  image=PIL.Image.open('apple.jpeg')
  uiu=tf.image.resize(np.array(image), (224,224))
      
  PIL.Image.fromarray(uiu.numpy(),&quot;RGB&quot;).save(&quot;apple1.jpeg&quot;)
  </code></pre>
  <p>Supposedly, <code>apple1.jpeg</code> should be the same as <code>apple.jpeg</code>, but they are different as follows:</p>
  <p><code>apple.jpeg</code>:</p>
  <p><a href="https://i.stack.imgur.com/eIfxh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eIfxh.png" alt="enter image description here" /></a></p>
  <p><code>apple1.jpeg</code>:</p>
  <p><a href="https://i.stack.imgur.com/5UaYV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5UaYV.png" alt="enter image description here" /></a></p>
  <p>Why is that image distorted when using <code>tf.image.resize</code>?</p>