system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What is the difference between BMP, JPG, PNG, and TGA photo formats.

I was looking through my FRAPS settings and I was curious as to the difference between the formats and which one would be the best to use.
gpt
Note: this is a simplified explanation. This is because this thread is in ELI5.

BMP stores your image as data in a grid. It essentially stores information as X1, Y1: blue. X2, Y1: blue. X3, Y1, red. It (normally) has no compression at all and takes up a huge amount of space on disk.

TGA works similarly to BMP, but also supports more features. Most important is the ability to store "transparency" - that is, how "much" of a color shows as opaque vs how much it lets whatever is "behind" it bleed through. This format takes even more space than BMP in normal situations, but can support compression (it usually doesn't).

PNG is similar to BMP and TGA in that it is "lossless". If you save your image as a PNG, it will look EXACTLY the same in the future. No data will be lost. Like TGA, it also supports transparency. The key difference is that it's a more modern format and is always compressed. This means it will take SUBSTANTIALLY less space than BMP or TGA under default settings.

JPG is the "lossy" image storage format. Saving an image as a JPG will always lose data - even if you already have a JPG, and change only a small item - after re-saving it, you will lose more data. It works by telling the computer "I want an image that looks like this". The computer then decides what the best approximation of that image would be to the human eye, and how best to save that without taking up too much space. It then saves the approximation to disk. This means the image will ALWAYS lose data.


To summarize:

* BMP has its uses. But typically most people do not want to use this format unless you need it specifically for a programming reason.

* TGA used to be the "de-facto" lossless format years ago. It currently takes much more space than PNG and isn't worth your time unless you need it specifically for a programming reason.

* PNG is the best format to use if you MUST have "lossless" image saving. Since it's compressed differently from JPG, it can actually beat JPG in size AND quality when the image contains large blocks of exact solid colors. It also is the only good choice among these 4 for transparent images used on web pages.

* JPG is the best format to use for photos if size is a concern. It offers the best balance of speed, usability, and quality for images which come from a photographic source and have many real-life incongruities which are otherwise indistinguishable to the naked eye.