r/AskComputerScience • • Sep 23 '25

Lossless Compression Algorithm

[removed]

0 Upvotes

33 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Sep 23 '25

[removed] — view removed comment

2

u/khedoros Sep 23 '25

I think you'd learn some things by building some file parsers. Something easy, like uncompressed .bmp, or the DOS .exe file format. Or read through the file format specs on one side of the screen, with an example file open in a hex editor on the other side. It's all data; nothing magic.

1

u/nuclear_splines Ph.D Data Science Sep 23 '25

the binary within the file tells the OS what application to use?

On modern operating systems it's typically the filename that clarifies what application to use. If you name a file foo.png then the OS will try to open it in an image viewer. If it's not a PNG, but actually an EXE, then the image viewer will go "hey, I don't see a PNG header in the first four bytes, this isn't a valid PNG."