What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Question About File Size


Rich54

Guru
Messages
1,836
Likes
3,602
In the link below, the OP posted a JPEG image of a car. I saved it to my computer, which says the file size is 4.15 MB. After I did a minor edit (adding new headlights), I re-saved the image as a JPEG using the maximum image quality (Level 12), at which point the new JPEG file became 9.36 MB and too large to post into the forum. Can anybody explain what caused the file to more than double in size (megabits) even though the pixel dimensions and resolution were unchanged from the original image? My only guess is that by using JPEG level 12, I somehow added information that was not there before, therefore increasing the file size.

https://www.photoshopgurus.com/forum/threads/headlight-photoshop.64295/
 
Thanks, this is interesting. I knew that increasing the amount of JPEG compression reduces the file size, but this article doesn't quite address the idea of increasing the file size—relative to the original file—by choosing zero compression (level 12).
 
HI Rich
The answer is simple that the image you started with was compressed at a higher compression JPEG setting than the one you used when saving it back out as a JPEG.

When you read in a JPEG image into Photoshop (or other software), it is decompressed back up to full individual pixel representation. The size of the original JPEG is a funtion of what the original OP used for compression (as it turns out it is what was used on an iPhone 6s). Then when you save it you are starting from an image in PS at full individual pixel represetation back to a compressed form at the compression setting you set. This could be lower or higher compression than the original image. In your case it was a lower compression setting (setting of the highest number in PS of 12) yielding a larger size image.

Using a program named JPEGsnoop you can see the details of what type of compression is used. There are large number of compression options that can be used which is made simple by choosing a simple number in PS (as well as in other software). A key factor in the compression is an 8x8 matrix of numbers (technical details not included) where the higher the numbers in the matrix the higher the compression.

This first two matrices show the numbers used in the original image for compressing Luminance and Chroinance respectively. Note numbers going up to 15 and 16 and a quality factor of around 92% (quality as determined by JPEGsnoop


Precision=8 bits
Destination ID=0 (Luminance)
DQT, Row #0: 2 2 2 3 5 6 8 10
DQT, Row #1: 2 2 2 3 5 6 8 10
DQT, Row #2: 2 2 3 5 6 8 10 12
DQT, Row #3: 3 3 5 6 8 10 12 14
DQT, Row #4: 5 5 6 8 10 12 14 15
DQT, Row #5: 6 6 8 10 12 14 15 15
DQT, Row #6: 8 8 10 12 14 15 15 15
DQT, Row #7: 10 10 12 14 15 15 15 15
Approx quality factor = 91.94 (scaling=16.12 variance=12.56)

*** Marker: DQT (xFFDB) ***
Define a Quantization Table.
OFFSET: 0x00003B6F
Table length = 67
----
Precision=8 bits
Destination ID=1 (Chrominance)
DQT, Row #0: 2 2 4 7 16 16 16 16
DQT, Row #1: 2 4 4 11 16 16 16 16
DQT, Row #2: 4 4 9 16 16 16 16 16
DQT, Row #3: 7 11 16 16 16 16 16 16
DQT, Row #4: 16 16 16 16 16 16 16 16
DQT, Row #5: 16 16 16 16 16 16 16 16
DQT, Row #6: 16 16 16 16 16 16 16 16
DQT, Row #7: 16 16 16 16 16 16 16 16
Approx quality factor = 92.03 (scaling=15.95 variance=1.27)

------------------------------------------------------------

Here are the same two matrices of the image saved at quality level 12 in PS. Note the max number is 3 and that the quality factor is 98:


Precision=8 bits
Destination ID=0 (Luminance)
DQT, Row #0: 1 1 1 1 1 1 1 2
DQT, Row #1: 1 1 1 1 1 1 1 2
DQT, Row #2: 1 1 1 1 1 1 2 2
DQT, Row #3: 1 1 1 1 1 2 2 3
DQT, Row #4: 1 1 1 1 2 2 3 3
DQT, Row #5: 1 1 1 2 2 3 3 3
DQT, Row #6: 1 1 2 2 3 3 3 3
DQT, Row #7: 2 2 2 3 3 3 3 3
Approx quality factor = 98.11 (scaling=3.79 variance=4.10)
----
Precision=8 bits
Destination ID=1 (Chrominance)
DQT, Row #0: 1 1 1 2 3 3 3 3
DQT, Row #1: 1 1 1 2 3 3 3 3
DQT, Row #2: 1 1 2 3 3 3 3 3
DQT, Row #3: 2 2 3 3 3 3 3 3
DQT, Row #4: 3 3 3 3 3 3 3 3
DQT, Row #5: 3 3 3 3 3 3 3 3
DQT, Row #6: 3 3 3 3 3 3 3 3
DQT, Row #7: 3 3 3 3 3 3 3 3
Approx quality factor = 98.36 (scaling=3.29 variance=0.42)

---------------------------------------

So as summary, you just saved it at a higher quality factor than the original image resulting in a larger file
Hope that helps a bit

John Wheeler
 

Back
Top