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

607 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

The data from your camera is not 1.5MB or 2.5MB. It is much more data than that, probably at least 40MB or more. But some of the data is thrown out (some extra pixels that are blanked out and only used to determine the noise of the sensor, and some of the extra bits to make sure the camera can record the brightest and darkest areas), then the images are compressed. Compression algorithms are quite complex but to drastically over simplify if you can find patterns in the numbers and short them down to make them smaller, you can save a lot of space. The problem is that two different images with two different sets of data will compress quite differently so one image might be able to get substantially smaller than another. JPGs, HEIF/HEIC, WEBP files are all compressed file formats that try to make the files smaller, but depending on the photo they will be able to compress them at different levels.

RAW files (which are supposed to be the data directly off the sensor) may be more similar in file size, but even those can sometimes be compressed to make them smaller and will vary a little (though they usually try to avoid “lossy” compression so the variation will not be as great). TIFF files often are uncompressed (they can be but it’s less common) and will more often be the same size or very close when coming from the same camera if they aren’t cropped differently (there will be minor differences for metadata).

Anonymous 0 Comments

What comes out of the sensor is called RAW file.
It is what the sensor sees.

Then, it is automatically transformed in a “corrected RAW” which include adjusting light (that’s one of the reason why pictures taken with less light are less sharp), and balancing white (believe it or not in your raw file a cloud can be blue or yellow or whatever).

This file is now fine for your eyes, but it’s a big file.

An algorithm will compress the file to a more convenient format, and then its stored. The most used compressed file is JPEG.

Even if the raw file are all big the same, during the compression similar pixels will be grouped together. some images will be compressed more than others, based on how ripetitive their pattern is, but we are talking of reducing the file size by 2-5 times.

All this steps are done automatically in you phone camera, while professionals cameras can save directly the RAW file so the photographer can personally adjust everything before compression (to avoid that the automatic compression may take some detail away)

Anonymous 0 Comments

Files are stored using compression because it’s not often feasible to store information for every single pixel individually. Some pictures compress more than others based on their complexity.

Try taking a picture with the lens covered (black), then try taking a picture of the sun shining through some trees. The all black picture will be smaller in file size because there’s less complexity, so it will be easier to compress.

Anonymous 0 Comments

Two things: amount of details and amount of green color. That’s how JPEG compression works. An image of a leafy tree could be the biggest.

BTW RAW image files could be the same size because they aren’t compressed.

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.

Anonymous 0 Comments

It depends on the photo’s file format – an agreed upon way to encode your picture. Certain file formats work better for certain pictures. Some pictures also have more data to store than other pictures.

Another aspect is lousy vs lossless. A lossless format seeks to keep the picture exactly as it was captured. This can result in a bigger file. The lousy file format discards parts and averages other parts to reduce the amount of data needed to describe the photo. Usually, the adjustments done when the photo is saved aren’t significantly noticable; however that’s not always the case. This can result in a smaller file.

To paint a metaphor for lousy vs lossless, consider a cooking recipe that calls for 3/4 cup water. Lossless would be measuring that water on a scale until this scale shows 3/4 cup water exactly. Lousy would be measuring up to line in my measuring cup and figuring that’s close enough. I may be off a little, but it likely won’t hurt the final result of my cooking.

Anonymous 0 Comments

When shot in RAW, they do not.

When converted to JPG, they do, because JPG’s are *compressed* and *lossy* file formats. They try and make the filesize small by throwing away bits of information you can’t easily see. For example, it knows you can’t see a difference between three very similar shades of blue, so it throws two away and pretends they’re the same. Now there’s less data in the image.

When you start seeing the difference is when the compression went too far. It’s usually most obvious on red shades.

Because no two images are identical, you get different file sizes. Lots of clear sky? Lots of blue to make look similar. Better compression. Smaller file.

Anonymous 0 Comments

Files from cameras are almost always compressed, which basically just looks for data that’s repeated in the image and only remembers it once, saving space. The more repeated data in that specific image, the smaller the file size will get.

Further more, most consumer cameras use “lossy,” compression, such as `.jpeg`. The actual process is pretty complicated, but in simplest terms it removes data from the image that you won’t notice is missing, saving tons of space. Downside is it makes professional work a little harder, but that’s fine if your just uploading to Instagram.

Anonymous 0 Comments

An uncompressed raw file will always have the same file size, as it saves the same data for the same amount of pictures. However most raw files are (lossless) compressed and include other information beside the picture info.

However most pictures you’ll come across won’t be in raw format. They’ll be things like jpg, png, gif. They can reduce the file size immensely, but the way they achieve that is very different.
Jpg is the most common format. If you want to see how it works I can recommend [this video](https://www.youtube.com/watch?v=fRjFwTbJfes). It has a very good way of showing how it all works.

Anonymous 0 Comments

think of it the same as painting a picture. if your painting has one large swathe of paint you can go over it in one stroke of the paint brush it is done. if your painting has lots of fine details you need to go over it again and again with different strokes to get all the different colored details. in this analogy each paint brush stroke is a piece of memory.

so a picture of a blue sky with a white mountains underneath my only have two main strokes and say eight accent strokes of shadows on the mountains, making relatively small photo memory wise. a photo of a rose bush requires dozens and dozens of strokes to save all the details of the shadows, leaves, flowers, etc. and will have a much bigger memory size.