jdhao's digital space
Recent content on jdhao's digital space
马上订阅 jdhao's digital space RSS 更新: https://jdhao.github.io/index.xml
Convert PIL or OpenCV Image to Bytes without Saving to Disk
2019年7月6日 22:18
Introduction #
Sometimes, we may want an in-memory jpg or png image that is represented as binary data. But often, what we have got is image in OpenCV (Numpy ndarray) or PIL Image format. In this post, I will share how to convert Numpy image or PIL Image object to binary data without saving the underlying image to disk.