No matter what kind of media you’re dealing with – music, photos or videos – it’s good to understand the file formats that they come in, and learning why you shouldn’t convert lossy files to lossless files, or compressed versus uncompressed.
What Is File Compression?
Compression is exactly what it sounds like: it “squashes” a file in order to make it smaller so it will take up less storage space. A common example of this happens in photography. When you take a photo, your camera’s sensors captures the light data from the scene and stores it in a format called RAW. A RAW file, which is not a type of image, is not strictly an uncompressed format. It is a “minimally processed format”, meaning you can think of it as a digital negative.
RAW files allow for greater control over things like white balance, color, and shadows & highlights during the post-processing phase. Most professional photographers try to shoot in RAW whenever possible, but since the format is uncompressed or lossless each file can be large in size – four RAW files that I shot last month totaled about 200 MB.
For this reason, many cameras including your smartphone shoot using the JPEG format by default. JPEG is a lossy, or compressed file format and lets each image be smaller than RAW files. When you convert a RAW file to a JPEG image, a compression algorithm removes some of the extraneous data from the file. Depending on the image quality, you may see some fuzziness or color noise, which are called JPEG artifacts. Lower quality images have more artifacts, which is a result of the compression.
File Formats: Lossy And Lossless
As stated above, lossy means compressed and lossless means uncompressed. Lossless files preserve the original data and lossy loses some data as a result of being “squashed”. Some examples of these formats:
- Images: RAW, BMP and PNG files are all lossless; JPEG and GIFs are lossy.
- Audio: WAV, FLAC and ALAC (Apple Lossless Audio Codec) are lossless; MP3 and OGG are lossy.
- Video: There aren’t a lot of lossless video formats used in consumer applications since these files would take up a huge amount of storage space. Instead, formats like H.264, MKV and WMV are lossy. H.264 has a smarter algorithm which can create small files that are still high quality.
Now, you can convert lossless files to lossy, but you can never uncompress a file by converting a lossy file to a lossless file. During the compression process, the unneeded data that gets removed can never be recovered. Once it’s gone, it’s gone for good.
Another example: ripping an audio CD, which is lossless, to an MP3, which is lossy. The MP3 is smaller because some of the original audio data has been lost. If you converted the MP3 to a lossless FLAC, that data is still lost; the FLAC quality would only be as good as the MP3 quality.
A rare exception to the rule that compressed files have less quality is PNG screenshots. Although PNG is lossless, it can still create high quality screenshots that are small in size, because of the flat RGB colors of a screen. However, if you shot a camera photo in PNG, it would be bigger than a screenshot because of the more complex colors of the 3D world.