I generated some plots in pandas and save it in BytesIO streams, and then I want to add it to a pdf page, then send out the pdf file as attachment in email:

```
import matplotlib.pyplot as plt
import io
from fpdf import FPDF

fig = plt.figure()
...
buf = io.BytesIO()
fig.savefig(buf, format='png')

pdf = FPDF()
pdf.add_page()
pdf.image(buf.getvalue(), type='PNG')
buf.close()

```

But this is not working, with the following error reported:

```
Traceback (most recent call last):
  File "XXXX.py", line 166, in send_email
    pdf.image(buf.getvalue(), type='PNG')
  File "/usr/local/lib/python3.6/site-packages/fpdf/fpdf.py", line 150, in wrapper
    return fn(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/fpdf/fpdf.py", line 971, in image
    info=self._parsepng(name)
  File "/usr/local/lib/python3.6/site-packages/fpdf/fpdf.py", line 1769, in _parsepng
    if name.startswith("http://") or name.startswith("https://"):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str

```

I want to solve this purely in memory and not to save image files locally. Can anyone help me with this? Thank you so much.