Re: Decoding the image-data from a notification

chandler <[email protected]> Thu, 2 Nov 2023 12:13:13 -0700
Newsgroups gmane.comp.freedesktop.dbus
Message-ID <[email protected]>
Thomas Kluyver wrote on 10/19/23 1:00 AM:
> If it's just one specific entry you need, it's probably simplest to
> manually copy and paste the values from your saved data. You can use
> bytes.fromhex() to convert the hex encoded data back to binary.

Figured it out finally!

After taking the hex data from the `array of bytes []` and putting it
all on one line (keeping the spaces between each character/byte), was
able to get an image with this python code:

import sys
from PIL import Image

hexstring = "00 00 [...] 00 00"
img = Image.frombytes("RGBA", (X, Y), bytes.fromhex(hexstring))
img.save("output.png")


Thanks!