title: Image frame saving from Video without losing resolution and quality
body: <p>I want to save the images extracted from the video without losing any information, resolution and quality. I have saved using OpenCV in four formats <code>png, bmp, jpg, tif</code> The code is as below</p>
  <pre><code>    file = &quot;video.MP4&quot;
      video = cv2.VideoCapture(file)    
      # Find OpenCV version
      (major_ver, minor_ver, subminor_ver) = (cv2.__version__).split('.')
      
      # With webcam get(CV_CAP_PROP_FPS) does not work.
      # Let's see for ourselves.
      
      if int(major_ver)  &lt; 3 :
          fps = video.get(cv2.cv.CV_CAP_PROP_FPS)
          print (&quot;Frames per second using video.get(cv2.cv.CV_CAP_PROP_FPS): {0}&quot;.format(fps))
      else :
          fps = video.get(cv2.CAP_PROP_FPS)
          print (&quot;Frames per second using video.get(cv2.CAP_PROP_FPS) : {0}&quot;.format(fps))
      
  
      # Number of frames to capture
      num_frames = 120;
      
      
      print (&quot;Capturing {0} frames&quot;.format(num_frames))
  
      # Start time
      start = time.time()
      
      data = []
      # Grab a few frames
      for i in range(0, num_frames) :
          ret, frame = video.read()
          data.append(frame)
      print(&quot;Shape&quot;,frame.shape)
      # End time
      end = time.time()
  
      # Time elapsed
      seconds = end - start
      print (&quot;Time taken : {0} seconds&quot;.format(seconds))
  
      # Calculate frames per second
      fps  = num_frames / seconds;
      print (&quot;Estimated frames per second : {0}&quot;.format(fps))
  
      for i,img in enumerate(data):
          fileName = 'Frames\img_'+ str(i) + '.tif'
          cv2.imwrite(fileName,img)
      # Release video
      video.release()
  </code></pre>
  <p>My Questions are</p>
  <ol>
  <li>In which of the format (<code>png, bmp, jpg, tif</code>) I should save so that it should not lose the resolution and quality of video.</li>
  <li>Just putting extension like <code>.tif</code> in <code>cv2.imwrite()</code> saves it to that particular format?</li>
  <li>Which library is the best to save <code>OpenCV, scikit-image or Pillow</code></li>
  </ol>
  <p>Any help or suggestion will be highly appreciated.</p>
  <p>Regards</p>