I am trying to get the rgb values of each pixel from a png image i took with the phone camera. The code i am using is:
f= open("E:\\Images\\minic1.png", "rb")
chunk = 
n = struct.unpack(">L", f.read(4))
if n==0: break #'IEND' chunk
data = zlib.decompress("".join(chunk))
unfortunately, this leaves me with the array 'data', whose elements are meant to be hex number values but come out in the form '\x00', which confuses python and it won't let me manipulate it as a string/convert it to a decimal number. It can compare this type of number to each other correctly( i.e. it could correctly deduce that, for example, 'x\00'>'\xff'), but that's about it. I tried changing the '\' with a '0' but it won't let me. How do i overcome this?
Thank you in advance,