But .txt is not the same as .rs; yet .txt is not the same as .docx, although both of these files look the same to the human eye.
But .txt is not the same as .rs; yet .txt is not the same as .docx, although both of these files look the same to the human eye.
There are thousands of types of file. They all contain data as a long sequence of numbers, and how those numbers are interpreted depends on the type of file - text characters, floating point numbers, pixel colour information or compressed data
What do u even mean by file type? Its the the extension .whatever that’s just a made up human label files artfully have a MIME type which is defiantly totally a different thing.
images are pixel colour information while audio and video are compressed data ?
an image, technically, is an array of pixels. specifically a 2-dimensional array. this means, it’s just a long list of lists of pixels. so if you have a 1920x1080 image, it’s just a list of 1080 lists of 1920 pixels each.
each pixel, again, is a tuple (i.e. a list with fixed length) of numbers which specify the brightness of red / green / blue lamp. so if you want to display a yellow pixel, the data would be (1.0, 1.0, 0.0) which turns red and green on and blue off.
so if you have a 1920x1080 image, technically you have 1920*1080*3 ≈ 6 million numbers. each number takes 32-bit, you can read it here
Depends on the file format. There is compressed and uncompressed audio - some times the numbers just represent the audio waveform (e.g. .wav) - some times with lossy lossless compression. Most, but not all, video formats are compressed due to the data size