title: Why does tensorflow decode jpeg images differently from scipy imread?
body: <p><code>tf.image.decode_jpeg()</code> function of Tensorflow gives  different numerical result than <code>scipy.misc.imread()</code> for <code>jpg</code> images. While the images look similar, pixel values are different.</p>
  
  <pre><code>import numpy as np
  import scipy
  import tensorflow as tf
  import matplotlib.pyplot as plt
  def minimal_example():
      def _bytes_feature(value):
          return tf.train.Feature(bytes_list=tf.train.BytesList(value=[value]))
  
      tffilename = 'astronaut.tfrecords'
      writer = tf.python_io.TFRecordWriter(tffilename)
      #image_source = 'https://upload.wikimedia.org/wikipedia/commons/8/88/Astronaut-EVA.jpg'
      image_path = 'astronaut.jpg'
      image_file = open(image_path,'rb')
      image = image_file.read()
      image_scipy = scipy.misc.imread(image_path)
      example = tf.train.Example(features=tf.train.Features(feature={'image':_bytes_feature(image)}))
      writer.write(example.SerializeToString())
      writer.close()
  
      record_iterator = tf.python_io.tf_record_iterator(path=tffilename)
      example = tf.train.Example()
      example.ParseFromString(next(record_iterator))
      image = example.features.feature['image'].bytes_list.value[0]
      image_tf = tf.image.decode_jpeg(image).eval(session=tf.Session())
      fig = plt.figure()
      ax1 = fig.add_subplot(121)
      ax2 = fig.add_subplot(122)
      ax1.imshow(image_scipy)
      ax2.imshow(image_tf)
      print('Reconstruction Error', np.sum(np.abs(image_tf - image_scipy)))
      plt.show()
  </code></pre>
  
  <p>result:</p>
  
  <pre><code>Reconstruction Error 3420883624
  </code></pre>
  
  <p>Is this a bug or am I doing something wrong?</p>