title: Python Telegram Bot - Send Image
body: <p>I'd like to send a Image (via URL or Path), on request.
  I use the source <a href="https://github.com/yukuku/telebot" rel="noreferrer">code here.</a>
  The code has already a sample to send an image (via URL or Path), but I don't get it since I'm new to Python.</p>
  <p>Here's the sample code snippet:</p>
  <pre><code>elif text == '/image':        #request
      img = Image.new('RGB', (512, 512))
      base = random.randint(0, 16777216)
      pixels = [base+i*j for i in range(512) for j in range(512)]  # generate sample image
      img.putdata(pixels)
      output = StringIO.StringIO()
      img.save(output, 'JPEG')
      reply(img=output.getvalue())
  </code></pre>
  <p>Some API infos can be <a href="https://core.telegram.org/bots/api#message" rel="noreferrer">found here.</a></p>
  <p>Thanks for your patience.</p>