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?
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.
The first image is a lot more complex than the second image.
The file processing system needs more data to record the first image.
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.
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.
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.
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.
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!
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.
[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.
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.
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.
If you want to reply, then
register here. Registration is free and your account is created instantly, so you can post right away.