Oscilloscope graph data cannot be converted to graphs

19 Views Asked by At

I have successfully saved the oscilloscope graph data into the variable image_data, but I can't convert the data of this variable into PNG file, BMP file, and so on.

How should I write ....

import pyvisa
from PIL import Image


rm = pyvisa.ResourceManager()


scope = rm.open_resource('USB0::0x0957::0x1796::MY63080487::0::INSTR')


scope.write(':DISPlay:DATA? PNG, COLOR')


image_data = scope.read_raw()

print(image_data)
b'#800017910\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x03 \x00\x00\x01\xf7\x08\x02\x00\x00\x00\xcc\xb6\xac\x81\x00\x00 \x00IDATx\x01\xed\xdd\xcd\xebnI~\x10\xf0\xfb\x0b\xb3\x18\x04w\x823\x12\x98\xc0\x0c\x98\xbf`z`L\x14\x17Y\x04\x1c!\x8b\x08\x01\xb3H\xb8\x1d\x08\x12!h@\x92\xce"m"\xc4\x10p\x90\x80\xf7G\xb2\x88\x10t\x16\x01G\xc8"\x0bQ\x87\x91t\xff\x05\x11f\xc0\x81\xe0\xb4\xe0N\x90Y\x04\xaf\xd5]\xdd\xdf\xae[\xe7\xe59\xef\xaf\x9f\xcbp\xa7N\x9d\xaaoU}\xea<\xcf\xf3\xed\xf3<}\xfa\xe9\xf5\xeb\xd7/\xfc!@\x80\x00\x01\x02\x04\x08\x10XN\xe0\x87\x96\x0b%\x12\x01\x02\x04\x08\x10 @\x80\xc0\x87\x02\x12,\xd7\x01\x01\x02\x04\x08\x10 @`a\x01\t\xd6\xc2\xa0\xc2\x11 @\x80\x00\x01\x02\x04$X\xae\x01\x02\x04\x08\x10 @\x80\xc0\xc2\x02\x9f\x89xOOO\xa9\xdc\xfc\xcd{Y\x9f\xcb\xb9K\xd9\xb2l\x13\x01S!\xd5\x97\xcd\xbaj\xa2K4n\x1d\xa8\xb52\xf7m\x9d@s\xf4\x18\xa8\xa7W:\x15\x03\xc5|\xa2}\xae\x89\x06\xa9>\xda\xacQ\x19\xe3\xf6\x0fT\x0e\x9d\xbb\xc4\xac\xf2a\xfa;\xb5\xa9*\x87\xd4D\xf7\xb2Pu\xcc\xa3W\xc1\xf3\x88\xe9\xeff}\x19\xaaY\xce\xd1r}\xee[\xd6\x94\xf5U\xdf\xd6Y\xf5\xb4O\xa7Fu)\xa7\x11\x8bj\xad\x8c\x89\xb5\x9e\x1d^\x99\xe3\xe4\xf61b\x04W @\x80\x00\x81#\x0b|\x9a`=\x9cez\xa3/\xdf\xe5\xe3\xb0Y\x88P\xa9}\x9cM\x95e9\xb7\xa9j\xf2\xe1\xf0\xca\x18\xa8Yh\r\xd5l\xd6S\xd35\xf9\xe1\xd3\x9b\xd9\xb2un\xad1\xcb}I\xbdR\x9b\xd6\xbe\xc7\xaf\x9c
0

There are 0 best solutions below