4 ms·
Can someone explain to me where the palette is defined? If it's not in the bytes of waldo.gif, is it provided by the website itself? If I save the gif file, I s
by ehsankia 5y ago
Can someone explain to me where the palette is defined? If it's not in the bytes of waldo.gif, is it provided by the website itself? If I save the gif file, I still see it as the same on my computer. Is it not true that the bytes of the gif actually 100% match the bytes of pi? Is there some extra metadata not included in the bytes of the file itself? If I were to send those bytes over the wire and save them to a file, would it look different?
- kundor 5y agoThe part that's from π is the actual pixel data, which is extracted in the Python snippet "waldo.tobytes()". More-or-less equivalently, you could use "list(waldo.getdata())". The GIF file as stored on disk has extra headers, and the pixel data's been compressed. So the whole file isn't found in the digits of π, just the pixel data itself. I'd guess the chance of actually finding a correctly formatted full GIF file in contiguous bytes of π is effectively nil.
- ehsankia 5y agoI see, I did find it slightly suspicious that they loaded the file using Image.open instead of just reading the bytes directly. Thanks!