title: How to send an PIL Image via telegram bot without saving it to a file
body: <p>For my telegram bot (<a href="https://github.com/python-telegram-bot/python-telegram-bot" rel="noreferrer">python-telegram-bot</a>) i generated a PIL.Image.Image and i want to send it directly to a user.</p>
  
  <p>What works is to send an image as bufferedReader from a file, but i don't want to safe the image. I don't need it again afterwards and i might generate a lot of different images at the same time, so saving is kind of messy.</p>
  
  <pre><code>bot.send_photo(chat_id=update.message.chat_id,
                 photo=open(img_dir, 'rb'),
                 caption='test',
                 parse_mode=ParseMode.MARKDOWN)
  </code></pre>
  
  <p>Because i generated it myself, i cant use an URL or file_id. I thought it might be possible to convert the image to a bufferedReader, but i only managed to get a bytes object from it, which didn't work.</p>
  
  <p>The image is generated like:</p>
  
  <pre><code>images = [Image.open(i) for i in dir_list]
  widths, heights = zip(*(i.size for i in images))
  total_width = sum(widths)
  max_height = max(heights)
  new_im = Image.new('RGBA', (total_width, max_height))
  
  x_offset = 0
  for im in images:
      new_im.paste(im, (x_offset, 0))
      x_offset += im.size[0]
  return new_im                 # returns a PIL.Image.Image
  </code></pre>
  
  <p>Thanks in advance :) merry x-mas</p>