Ugly Hedgehog - Photography Forum
Home Active Topics Newest Pictures Search Login Register
Main Photography Discussion
File Size Question
Page 1 of 2 next>
Nov 16, 2019 11:59:37   #
lorvey Loc: Lincoln, Nebraska
 
The pixel dimensions on these two photos is identical (3000 X 4000}. Both images were taken with my iPhone 7, so these are straight from the "camera". The file size of the first image is 5.3MB and the second one is 1.8MB. For the technical experts out there, I'm just curious, why is the file size so different? Must have something to do with black pixels vs white pixels?


(Download)


(Download)

Reply
Nov 16, 2019 12:05:14   #
Blair Shaw Jr Loc: Dunnellon,Florida
 
lorvey wrote:
The pixel dimensions on these two photos is identical (3000 X 4000}. Both images were taken with my iPhone 7, so these are straight from the "camera". The file size of the first image is 5.3MB and the second one is 1.8MB. For the technical experts out there, I'm just curious, why is the file size so different? Must have something to do with black pixels vs white pixels?


I am not an expert on pixels but I would think it was because the 1st image had a lot more details than the 2nd image and not the color differences. Others will most likely fill you in on the exact reasons I would hope.


Reply
Nov 16, 2019 12:06:00   #
RichardTaylor Loc: Sydney, Australia
 
The first image is a lot more complex than the second image.
The file processing system needs more data to record the first image.

Reply
 
 
Nov 16, 2019 12:06:26   #
Longshadow Loc: Audubon, PA, United States
 
File size depends on what is IN the photo.
The more complicated (detail, colors), the larger the file size as it takes more information to store all the intricacies. The more plain an image is, it is simpler to store the information, ergo smaller file size.
It has nothing to do with pixel dimensions, other than the fact that that larger pixel dimensions will yield larger files, but size based on the content will still apply.

Pixel dimensions are only a part of the file size.
The file size will NOT be 3000x4000.
It will be 3000x4000 (12Meg) PLUS the level of complexity.

Reply
Nov 16, 2019 12:28:39   #
BebuLamar
 
JPEG file size depends a lot on what's in the picture. Just a test I used Photoshop to create a 24MP image of only medium gray and the file size is something like 1MB or so.

Reply
Nov 16, 2019 16:35:40   #
BigDaddy Loc: Pittsburgh, PA
 
lorvey wrote:
The pixel dimensions on these two photos is identical (3000 X 4000}. Both images were taken with my iPhone 7, so these are straight from the "camera". The file size of the first image is 5.3MB and the second one is 1.8MB. For the technical experts out there, I'm just curious, why is the file size so different? Must have something to do with black pixels vs white pixels?

The file sizes are different because of how file compression works. Your image size is 3000 x 4000 which will not change unless you resize or crop your photo. Compression never changes pixel dimensions. It encodes the information. In jpgs case it encodes all the colors then decodes them when you view your file with any jpg viewer. Encoding photos (or mp3 or executable files) as opposed text files is problematic because there's generally not large blocks of information (colors) that are repeating (among other things).

Jpeg attempts to encode colors that are not exactly the same but very similar, so similar that hopefully only a computer can determine the difference (humans are limited in how many color variations they can see, computers are not) This works exceptionally well at moderate levels of compression. You can make it work less well with increased compression at the cost of file size.

If your picture has lots of color variation, it will not be able to group colors for encoding as well as it would for a photo with less color variation resulting in less compression and larger file size. Regardless, when it (your viewer) decodes (decompresses) your file, it will not only be the exact same size (pixel dimension) it was before compression, but will hopefully (99% of the time) look exactly as it did before compression.

It is important to recognize that jpg will not re-compress your file simply by opening and closing it. However, if you edit the file in any way after opening it, it will re-compress the file again if you save the changes over the original jpg. This will result in jpeg attempting to match similar colors again, and again, and again, each time you make changes. This eventually will start to look bad, just as if you increase compression levels in to begin with. Fortunately this is easily avoided.

Reply
Nov 16, 2019 17:15:30   #
DirtFarmer Loc: Escaped from the NYC area, back to MA
 
Although jpg compression could be the cause of the size difference there could be another reason.
My iPhone (8+) records some images in jpg format and others in heif. Heif is really partly video which creates a much larger file. I haven't been concerned enough to look into how the iPhone decides which format it uses but on my iPhone it seems to be random, with heif predominating.

Most of the heif images on my phone are much larger, some in the 15MByte range.

Reply
 
 
Nov 17, 2019 07:16:05   #
LarryFitz Loc: Beacon NY
 
BigDaddy wrote:
The file sizes are different because of how file compression works. Your image size is 3000 x 4000 which will not change unless you resize or crop your photo. Compression never changes pixel dimensions. It encodes the information. In jpgs case it encodes all the colors then decodes them when you view your file with any jpg viewer. Encoding photos (or mp3 or executable files) as opposed text files is problematic because there's generally not large blocks of information (colors) that are repeating (among other things).

Jpeg attempts to encode colors that are not exactly the same but very similar, so similar that hopefully only a computer can determine the difference (humans are limited in how many color variations they can see, computers are not) This works exceptionally well at moderate levels of compression. You can make it work less well with increased compression at the cost of file size.

If your picture has lots of color variation, it will not be able to group colors for encoding as well as it would for a photo with less color variation resulting in less compression and larger file size. Regardless, when it (your viewer) decodes (decompresses) your file, it will not only be the exact same size (pixel dimension) it was before compression, but will hopefully (99% of the time) look exactly as it did before compression.

It is important to recognize that jpg will not re-compress your file simply by opening and closing it. However, if you edit the file in any way after opening it, it will re-compress the file again if you save the changes over the original jpg. This will result in jpeg attempting to match similar colors again, and again, and again, each time you make changes. This eventually will start to look bad, just as if you increase compression levels in to begin with. Fortunately this is easily avoided.
The file sizes are different because of how file c... (show quote)


Good Answer

Reply
Nov 17, 2019 08:05:07   #
f8lee Loc: New Mexico
 
BigDaddy wrote:
The file sizes are different because of how file compression works. Your image size is 3000 x 4000 which will not change unless you resize or crop your photo. Compression never changes pixel dimensions. It encodes the information. In jpgs case it encodes all the colors then decodes them when you view your file with any jpg viewer. Encoding photos (or mp3 or executable files) as opposed text files is problematic because there's generally not large blocks of information (colors) that are repeating (among other things).

Jpeg attempts to encode colors that are not exactly the same but very similar, so similar that hopefully only a computer can determine the difference (humans are limited in how many color variations they can see, computers are not) This works exceptionally well at moderate levels of compression. You can make it work less well with increased compression at the cost of file size.

If your picture has lots of color variation, it will not be able to group colors for encoding as well as it would for a photo with less color variation resulting in less compression and larger file size. Regardless, when it (your viewer) decodes (decompresses) your file, it will not only be the exact same size (pixel dimension) it was before compression, but will hopefully (99% of the time) look exactly as it did before compression.

It is important to recognize that jpg will not re-compress your file simply by opening and closing it. However, if you edit the file in any way after opening it, it will re-compress the file again if you save the changes over the original jpg. This will result in jpeg attempting to match similar colors again, and again, and again, each time you make changes. This eventually will start to look bad, just as if you increase compression levels in to begin with. Fortunately this is easily avoided.
The file sizes are different because of how file c... (show quote)


An excellent answer - kudos!

Reply
Nov 17, 2019 08:40:33   #
Architect1776 Loc: In my mind
 
lorvey wrote:
The pixel dimensions on these two photos is identical (3000 X 4000}. Both images were taken with my iPhone 7, so these are straight from the "camera". The file size of the first image is 5.3MB and the second one is 1.8MB. For the technical experts out there, I'm just curious, why is the file size so different? Must have something to do with black pixels vs white pixels?


Detail is totally different.

Reply
Nov 17, 2019 08:52:37   #
joer Loc: Colorado/Illinois
 
BigDaddy wrote:
The file sizes are different because of how file compression works. Your image size is 3000 x 4000 which will not change unless you resize or crop your photo. Compression never changes pixel dimensions. It encodes the information. In jpgs case it encodes all the colors then decodes them when you view your file with any jpg viewer. Encoding photos (or mp3 or executable files) as opposed text files is problematic because there's generally not large blocks of information (colors) that are repeating (among other things).

Jpeg attempts to encode colors that are not exactly the same but very similar, so similar that hopefully only a computer can determine the difference (humans are limited in how many color variations they can see, computers are not) This works exceptionally well at moderate levels of compression. You can make it work less well with increased compression at the cost of file size.

If your picture has lots of color variation, it will not be able to group colors for encoding as well as it would for a photo with less color variation resulting in less compression and larger file size. Regardless, when it (your viewer) decodes (decompresses) your file, it will not only be the exact same size (pixel dimension) it was before compression, but will hopefully (99% of the time) look exactly as it did before compression.

It is important to recognize that jpg will not re-compress your file simply by opening and closing it. However, if you edit the file in any way after opening it, it will re-compress the file again if you save the changes over the original jpg. This will result in jpeg attempting to match similar colors again, and again, and again, each time you make changes. This eventually will start to look bad, just as if you increase compression levels in to begin with. Fortunately this is easily avoided.
The file sizes are different because of how file c... (show quote)



Reply
 
 
Nov 17, 2019 10:13:41   #
lorvey Loc: Lincoln, Nebraska
 
[quote=BigDaddy]The file sizes are different because of how file compression works. Your image size is 3000 x 4000 which will not change unless you resize or crop your photo. Compression never changes pixel dimensions. It encodes the information. In jpgs case it encodes all the colors then decodes them when you view your file with any jpg viewer. Encoding photos (or mp3 or executable files) as opposed text files is problematic because there's generally not large blocks of information (colors) that are repeating (among other things).

BigDaddy, thank you for responding. So, I am taking from this that the first image, the darker of the two, has more color variation, more detail, so it was not possible to compress the file as much as the second image. The second image must have more common color bits or pixels which makes it possible to compress further. This is probably an over simplification of what it is doing, but I am trying to understand this in layman's terms.

Reply
Nov 17, 2019 10:28:54   #
lorvey Loc: Lincoln, Nebraska
 
DirtFarmer wrote:
Although jpg compression could be the cause of the size difference there could be another reason.
My iPhone (8+) records some images in jpg format and others in heif. Heif is really partly video which creates a much larger file. I haven't been concerned enough to look into how the iPhone decides which format it uses but on my iPhone it seems to be random, with heif predominating.

Most of the heif images on my phone are much larger, some in the 15MByte range.


I am familiar with the heif format and I'm pretty sure it was not shot or stored in that format. I changed my iPhone a while back to always shoot in JPG. But thank you for your response.

Reply
Nov 17, 2019 10:31:43   #
lorvey Loc: Lincoln, Nebraska
 
I'd like to thank everyone for your thoughts and responses on this subject. It is somewhat of a boring question and not necessarily related to improving our photo skills, but I was still curious about the issue.

Reply
Nov 17, 2019 11:07:58   #
Bultaco Loc: Aiken, SC
 
Blair Shaw Jr wrote:
I am not an expert on pixels but I would think it was because the 1st image had a lot more details than the 2nd image and not the color differences. Others will most likely fill you in on the exact reasons I would hope.




Reply
Page 1 of 2 next>
If you want to reply, then register here. Registration is free and your account is created instantly, so you can post right away.
Main Photography Discussion
UglyHedgehog.com - Forum
Copyright 2011-2024 Ugly Hedgehog, Inc.