I have to convert each pixel to binary.import pyb
from JPEGdecoder import jpeg
with open('photo4.jpg', 'rb') as f:
data = f.read()
print(data)
frombuffer is also represented in matrix form, I also need such a function.
but the result is
like thisb'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x01\x00`\x00`\x00\x00\xff\xdb\x00C\x00\x02\x01\x01\x02\x01\x01
So, how can I convert each pixel to binary?