If you were to use no compression, then sure, every picture would be the same size. For every pixel, you would need 3 bytes of information (or more with more colour depth). Your 2.5MB file wouldn’t even be a full megapixel.
Instead, we use compression algorithms to reduce the amount of data we need to actually hold. We can do things like only store the difference between one pixel and the pixel next to it, since those tend to be very similar values.
The algorithms for good compression can get very complicated very quickly. There are also two forms of compression — lossy and lossless. With lossless compression, you can get the raw file back in its exact format. With lossy compression, you get something that isn’t pixel perfect compared to the original, but (ideally) a human eye can’t tell the difference.
Latest Answers