title: Python: Remove Exif info from images
body: <p>In order to reduce the size of images to be used in a website, I reduced the quality to 80-85%. This decreases the image size quite a bit, up to an extent.</p>
  
  <p>To reduce the size further without compromising the quality, my friend pointed out that raw images from cameras have a lot of metadata called Exif info. Since there is no need to retain this Exif info for images in a website, we can remove it. This will further reduce the size by 3-10 kB.</p>
  
  <p>But I'm not able to find an appropriate library to do this in my Python code. I have browsed through related questions and tried out some of the methods:</p>
  
  <p>Original image: <a href="http://mdb.ibcdn.com/8snmhp4sjd75vdr27gbadolc003i.jpg" rel="noreferrer">http://mdb.ibcdn.com/8snmhp4sjd75vdr27gbadolc003i.jpg</a></p>
  
  <ol>
  <li><p><a href="http://www.imagemagick.org/www/mogrify.html" rel="noreferrer">Mogrify</a></p>
  
  <pre><code>/usr/local/bin/mogrify -strip filename
  </code></pre>
  
  <p>Result: <a href="http://s23.postimg.org/aeaw5x7ez/8snmhp4sjd75vdr27gbadolc003i_mogrify.jpg" rel="noreferrer">http://s23.postimg.org/aeaw5x7ez/8snmhp4sjd75vdr27gbadolc003i_mogrify.jpg</a>
   This method reduces the size from 105 kB to 99.6 kB, but also changed the color quality.</p></li>
  <li><p><a href="https://exiftool.org/" rel="noreferrer">Exif-tool</a></p>
  
  <pre><code>exiftool -all= filename
  </code></pre>
  
  <p>Result: <a href="http://s22.postimg.org/aiq99o775/8snmhp4sjd75vdr27gbadolc003i_exiftool.jpg" rel="noreferrer">http://s22.postimg.org/aiq99o775/8snmhp4sjd75vdr27gbadolc003i_exiftool.jpg</a>
  This method reduces the size from 105 kB to 72.7 kB, but also changed the color quality.</p></li>
  <li><a href="https://stackoverflow.com/questions/765396/exif-manipulation-library-for-python/765403#765403">This answer</a> explains in detail how to manipulate the Exif info, but how do I use it to remove the info?</li>
  </ol>
  
  <p>Can anyone please help me remove all the extra metadata without changing the colours, dimensions, and other properties of an image?</p>