How do different images from the same camera vary in file size?

625 views

Wouldn’t a camera with a constant resolution capture images of the same quality and therefore file size? How is it possible that some images on my camera can be 1.5 MB, and others 2.5 MB?

In: Technology

17 Answers

Anonymous 0 Comments

Take this simple line-art drawing of a [stick-figure](https://en.wikipedia.org/wiki/Stick_figure#/media/File:Stick_Figure.svg). Now imagine you want to store information about this drawing on a sheet of paper in text format.

You could write down something like this, describing every single dot on the image:

0, 0 = white
0, 1 = white
0, 2 = white
….
300, 200 = black
….

This is how “bmp” format works – it literally stores every single pixel color. All images of same size will take the same amount of lines to describe. But it will be also horribly inefficient and will need tons of lines.

So you could make it better by doing some simple ranges:

0, 0 – 300, 199 = white
300, 199 – 300, 203 = black
300, 203 – 300, 400 = white
… etc

Now you would need much less lines of text to describe the image, especially if you have long areas of white and black.

However, if you actually download this image, you will see that it’s size is a mere 5kb. The reason is, it’s stored as strokes instead of pixels:

background = white
black line from 100,100 to 150,150
black circle with centre at 100, 80 and radius of 20
…. etc.

This is general idea of how “compression” works. The problem with it though – the more “complicated” the picture is – the more “lines” or “strokes” it will need even though the size of “canvas” is the same.

What cameras do – they try to convert the real picture (BMP format) into those abstract “strokes”. The “strokes” can have different colour, shape, size, gradients, etc.

They also allow to sometimes replace a complicated tiny pattern with a simplified stroke – that’s called “lossfull” compression, as it loses some information. But the result of this is – that the quality of picture might go down a bit, but it still takes much less data to convey the “strokes” instead of each pixel individually.

TL;DR: Computer stores instructions on how to re-paint the picture when it’s opened, not every individual pixel. Like an ultra-realism artist replicating a photo from memory.

You are viewing 1 out of 17 answers, click here to view all answers.