File size: 139 Bytes
3370ff8
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10

import io
from PIL import Image


def fig2img(fig):
    buf = io.BytesIO()
    fig.savefig(buf)
    buf.seek(0)
    return Image.open(buf)