title: Reading a .JPG Image and Saving it without file size change
body: <p>I want to write a python code that reads a .jpg picture, alter some of its RBG components and save it again, without changing the picture size. </p>
  
  <p>I tried to load the picture using OpenCV and PyGame, however, when I tried a simple Load/Save code, using three different functions, the resulting images is greater in size than the initial image. This is the code I used.</p>
  
  <pre><code>&gt;&gt;&gt; import cv, pygame # Importing OpenCV &amp; PyGame libraries.
  &gt;&gt;&gt; image_opencv = cv.LoadImage('lena.jpg')
  &gt;&gt;&gt; image_opencv_matrix = cv.LoadImageM('lena.jpg')
  &gt;&gt;&gt; image_pygame = pygame.image.load('lena.jpg')
  &gt;&gt;&gt; cv.SaveImage('lena_opencv.jpg', image_opencv)
  &gt;&gt;&gt; cv.SaveImage('lena_opencv_matrix.jpg', image_opencv_matrix)
  &gt;&gt;&gt; pygame.image.save(image_pygame, 'lena_pygame.jpg')
  </code></pre>
  
  <p>The original size was 48.3K, and the resulting are 75.5K, 75.5K, 49.9K.</p>
  
  <p>So, I'm not sure I'm missing something that makes the picture original size changes, although I only made a Load/Save, or not?</p>
  
  <p>And is there a better library to use rather than OpenCV or PyGame ?!</p>