title: multiple tiff images to pdf with python
body: <p>I have a image file list and I would like to generate a single output.pdf file with these images.</p>
  
  <p>The following code works with one image file only (here the first element of image_list):</p>
  
  <pre><code>with open("output.pdf","wb") as f, io.BytesIO() as output:
      img = Image.open(image_list[0])
      img.save(output, format='tiff')
      f.write(img2pdf.convert(output.getvalue()))
  </code></pre>
  
  <p>How can I adapt this code to work with the complete list of image files ?</p>
  
  <p>I tried :</p>
  
  <pre><code>with open("output.pdf","wb") as f, io.BytesIO() as output:
          img = Image.open(image_list[0])
          img.save(output, format='tiff')
          img2 = Image.open(image_list[1])
          img2.save(output, format='tiff')
          f.write(img2pdf.convert(output.getvalue()))
  </code></pre>
  
  <p>but it doesn't work (the created pdf contain only the last image, ie image_list[1]) </p>