본문 바로가기
Python

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

by bryan.oh 2022. 6. 20.
반응형
import io

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

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

 

728x90
반응형

댓글