Python

[Python] PIL.Image 를 byte array 로 변환

bryan.oh 2022. 6. 20. 21:29
반응형
import io

img = Image.open('file_path', mode='r')

buffer = io.BytesIO()
img.save(buffer, format='PNG')
buffer.seek(0)

 

728x90
반응형