Post Reply 

file sizes different with same resolution

Apr 26, 2011, 23:00
Post: #1
file sizes different with same resolution
I've received several scanned images from another party in .jpg format. The file sizes of some run about 100k and others about 300k.

When I looked at the image properties they were almost the same for each of them. All of them had a resolution of 96x96 and each having around 40,000 pixels (roughly 500X800 pixel images). The print sizes were all about 5.5x8.5 inches.

Why would .jpg images with similar pixel resolution and number have such different file sizes?

Any insight would be extremely helpful.

Bob
Find all posts by this user
Quote this message in a reply
Apr 26, 2011, 23:34
Post: #2
RE: file sizes different with same resolution
It depends a lot on the image content. An image with large uniform areas compresses better than one with lots of small detail. Grass and foliage produce bigger pictures than buildings...

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Apr 27, 2011, 00:19
Post: #3
RE: file sizes different with same resolution
Jpeg is what is known as a "lossy" image compression format. It uses certain "tricks" based on how the human eye sees images to actually throw away certain data that is less important to the image. This is also adjustable which means that you can dial in as much compression as you want, but the information being saved gets further and further degraded. The trick is to use as much compression as you can (for smallest file size) while not using so much that the image looks unacceptable. Of course each person has their own idea of how much image degradation is acceptable versus what file size is too big.

Try an experiment for yourself. Open an image in Gimp, preferably a good quality, high resolution photo rather than simple line art. Now use File > Save a Copy to save the image as a jpeg. Move the quality slider all the way to the right to 100 and name it Image01.jpg or something similar. Using "Save a Copy" will leave the original image you're working on unchanged for the next steps. Now do the same thing, only move the Quality slider down to about 90 and call it Image02.jpg. Do this until you have about 5 or 6 copies saved. Now go to the directory where you saved them and check the file sizes. When you open them, the ones saved at 100 and 90 should look nearly identical to the original. By the time you get down to 80 you can begin seeing halos and other artifacts along sharp edges between two noticeably different colors if you look closely. By the time you get to the ones saved at 60 or 50 or below, the image is usually pretty bad looking.

This is also why it is not a good idea to re-save a jpeg. Each time you save it, then open it and save it again, more data is lost, eventually degrading the image so badly its hardly worth saving. This brings up the other type of image file like Tiff and PNG, which are "lossless". They use methods similar to zip files to compress the image data without throwing any away. The advantage is that no matter how many times it is opened and saved, it is still exactly the same as the original. Of course the trade-off is file size, which is usually bigger than it is for lossy formats.

[Image: viragogimpforumssig.png]
Find all posts by this user
Quote this message in a reply
Apr 27, 2011, 00:41
Post: #4
RE: file sizes different with same resolution
(Apr 27, 2011 00:19)Virago Wrote:  This is also why it is not a good idea to re-save a jpeg. Each time you save it, then open it and save it again, more data is lost, eventually degrading the image so badly its hardly worth saving.
This is one of the great urban legends of the photo forums Rolleyes. Actually, as long as you don't do general changes (color balance, etc...) or changes to the JPEG compression settings, you will save exactly the same pixels as you loaded. You can edit an image, add your signature in the corner, and resave it and this won't impact the pixels outside of the 8x8 pixel blocks covered by the signature. I have a little Perl script to demonstrate this (PM me if interested).

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Apr 27, 2011, 02:23
Post: #5
RE: file sizes different with same resolution
(Apr 27, 2011 00:41)ofnuts Wrote:  This is one of the great urban legends of the photo forums Rolleyes. Actually, as long as you don't do general changes (color balance, etc...) or changes to the JPEG compression settings, you will save exactly the same pixels as you loaded. You can edit an image, add your signature in the corner, and resave it and this won't impact the pixels outside of the 8x8 pixel blocks covered by the signature. I have a little Perl script to demonstrate this (PM me if interested).

What you say is true of course, but the part about not doing any general changes and using the same compression settings are two pretty big if's.

Overall, while I basically agree with you, I still think that re-saving a jpeg is something to be generally avoided if possible, and something you don't want to tell others to do even if the technical realities mean that isn't necessarily 100% accurate in all cases.

[Image: viragogimpforumssig.png]
Find all posts by this user
Quote this message in a reply
Apr 27, 2011, 15:40
Post: #6
RE: file sizes different with same resolution
(Apr 26, 2011 23:34)ofnuts Wrote:  It depends a lot on the image content. An image with large uniform areas compresses better than one with lots of small detail. Grass and foliage produce bigger pictures than buildings...

That's the problem. They are essentially identical images in terms of content. They were scanned images from an old high school yearbook. See the attached scaled version of one of them. All of the others include the 4 photos with some comments about each of the individuals.

In an image viewer one can see some difference in the quality of the scanned images with different file sizes. But, the mystery to me is the number of pixels and resolution being almost the same for all of them.

Bob


Attached File(s) Image(s)
   
Find all posts by this user
Quote this message in a reply
Apr 27, 2011, 16:00
Post: #7
RE: file sizes different with same resolution
(Apr 27, 2011 15:40)kubobby Wrote:  
(Apr 26, 2011 23:34)ofnuts Wrote:  It depends a lot on the image content. An image with large uniform areas compresses better than one with lots of small detail. Grass and foliage produce bigger pictures than buildings...

That's the problem. They are essentially identical images in terms of content. They were scanned images from an old high school yearbook. See the attached scaled version of one of them. All of the others include the 4 photos with some comments about each of the individuals.

In an image viewer one can see some difference in the quality of the scanned images with different file sizes. But, the mystery to me is the number of pixels and resolution being almost the same for all of them.

Bob
Once again the attachment isn't working :-( I see that the background is a faint color. If it's printed material, it's likely dithered. And if it's not smoothed, this is a lot of detail to store. This could be an explanation.

Try to extract equivalent parts in both, and see if these size ratio remains the same (if so post both extracts here)

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Apr 27, 2011, 23:57 (This post was last modified: Apr 28, 2011 00:04 by kubobby.)
Post: #8
RE: file sizes different with same resolution
(Apr 27, 2011 16:00)ofnuts Wrote:  [quote='kubobby' pid='3139' dateline='1303918828']
[quote='ofnuts' pid='3123' dateline='1303860875']

Once again the attachment isn't working :-( I see that the background is a faint color. If it's printed material, it's likely dithered. And if it's not smoothed, this is a lot of detail to store. This could be an explanation.

Try to extract equivalent parts in both, and see if these size ratio remains the same (if so post both extracts here)

I did extract 500 x 200 segments of both images, one of which had an original file size of 295kb and the other of original file size 86kb. I saved the segments at 85 quality and found that both had almost equivalent file sizes of about 34kb.

Very interesting.

It became even more interesting when I then selected most of each original image, roughly 775 x 500 each, and saved them as jpg with 85 quality setting. I saved them and both had file sizes of roughly 110kb.

I don't know why the difference from original to selection size of file occurs when I used most of the image as a selection, but I'm happy to say that they now can be used for our web pages.

Thanks 'ofnuts' for the tip on taking a selection and saving the selection to compare file sizes afterwards. Don't understand why it happened, but I live in a world of ignorance for the most part anyway.Smile

Bob
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Recently Used File List foberle 1 47 Oct 14, 2017 13:55
Last Post: ythgilb
  nothing works from the File menu, can't save, export, close, etc jperiod 1 136 Aug 3, 2017 05:19
Last Post: ythgilb
  Photo resolution vs size sonnystarks 1 235 Jun 13, 2017 05:18
Last Post: ythgilb
  Saved file, can no longer interact with image Tatsuno 5 341 Sep 28, 2014 21:54
Last Post: iForStyle007
  SVGZ File anon_private 4 434 Sep 8, 2014 11:36
Last Post: anon_private

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS