Image sizes. If the camera settings stays the same and the image is stored as a set of pixel values, why does the image size change?


On my smartphone, the largest image is around 8mb and the smallest in the same camera settings is around 2mb (images of different objects though). Why is there such a huge difference in image size?


It has to do with the way image compression works. If you have an image with large uniform areas, like a blue cloudless sky, compression is going to be a lot more efficient than with an image with a lot of detail. Let’s just assume you have 200 blue pixels in a row as opposed to a mix of blue and white in a cloudy sky, the image compression format can basically say “200 times blue” instead of saying “blue, then white, then blue, then white again…” Generally speaking, less change in color across a row of pixels means better compression. That’s why some images can be reduced to a very small size and some need more space, because they need to store more specific information about the different parts of the image.

The images are likely being compressed.

Say for example you take a picture of someone in front of a flat white wall. Uncompressed the photo file would have to explicitly store that every single individual pixel of the wall is white, while a compressed file would store “all the pixels between *here* and *here* is white.

Uncompressed: 1, white 2, white 3, white 4, white…

Compressed 1 – 4, white.

Photos of highly varied and colorful scenes can’t be compressed as much and therefore the file is larger.