r/AskComputerScience • • Sep 23 '25

Lossless Compression Algorithm

[removed]

0 Upvotes

33 comments sorted by

View all comments

Show parent comment

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."