
Whether it is image, music or video files, it is important to understand the difference between different types of formats and when to use them. Using the wrong format can ruin the quality of a file or make the file size unnecessarily large.

Some types of media file formats are “lossy” and some types “lossless”. We will explain what these terms mean for the benefits of each type of file format and why you should never convert lossy to lossless formats.
Compression explained.
We use compression to make files smaller so they can retrieve faster and take up less storage space. For example, when you take a photo, your camera captures all the light you can get and collects an image. If you save the image in RAW format, which retains all the clear data that the camera sensor receives, the image can reach 25 MB. (Depending on image resolution: A multi-megapixel camera provides a larger image.)

If we upload these files to a social network or put them on a website, we don’t want these image files to take up so much space. A photo gallery with RAW images could take hundreds of megabytes of space. RAW formats can be used by professional photographers to maintain high image quality during the editing process, but they are not intended for the average person.
Instead, our camera or smartphone converts the image into a JPEG file. JPEG files are much, much smaller than RAW images. When you convert RAW to JPEG, some of the image data is “discarded”, which produces a much smaller file. The conversion process uses a compression algorithm that works well for photos, so they can look pretty good despite compression. You can still see compression elements, depending on the quality settings.
Note that lost formats generally have a setting that controls their loss. For example, JPEG has a variable quality setting. Low quality produces a smaller JPEG image file, but the image quality is significantly poorer. Below is a close-up example of a lost JPEG: various “compression artifacts” can be seen.
We call RAW a “lossless” format because it retains all the original data in the file, while we call JPEG a “lost” format because some data is lost when we convert an image to JPEG. However, these are not the only design and loss-free formats.
Images: RAW, BMP and PNG are all image formats without data loss. JPEG and WebP are lost image formats.
Audio: WAV is a container file that is often used to contain lossless audio, although it is also capable of containing lost sound. FLAC is a lossless audio format, while MP3 is a lossless audio format.
Video: Consumers use few lossless video formats as they involve video files taking up a large amount of space. Common formats like H.264 and H.265 are all lost. H.264 and H.265 can deliver smaller files with higher quality than previous generations of video codecs because it has a “smarter” algorithm that is better at choosing which data to discard.
Some of these lossless formats also provide compression. For example, a WAV file generally contains uncompressed audio and takes up little space. A FLAC file may contain the same lossless sound as a WAV file, but it uses compression to continue creating a smaller file. Formats like FLAC provide no data: they store all data and compress them intelligently, just like ZIP archives. However, they are still much larger in size than MP3s that throw a lot of data.
A conversion can be a loss, even between formats without data loss. For a conversion to be effectively lossless, the data in the original file must fit within the destination file. For example, loss without FLAC files only supports 24-bit audio. If you converted a WAV file containing 32-bit PCM audio to FLAC, the conversion process must generate some data. The conversion process between a WAV file containing 24-bit PCM audio in FLAC would be lossless.





