Page 1 of 1

Smaller image has same file size

Posted: Tue Nov 18, 2003 5:45 pm
by Greg Martin
When i resize a picture, the picture is smaller but file size is same.

Example: I resize 50% screen size (i have checked "Keep ratio") picture size is 373.92kb and after resize size is 376.24kb. Ok i do it again and now picture size is 104.27kb but picture is too small.

This picture is 72 pixels per inch but if my picture is 300, resize works great?

What here happen :?: :?: :?:

Re: Smaller image has same file size

Posted: Tue Nov 18, 2003 9:26 pm
by helmut
The phenomenom you observe might surprise other people, too:
You have a JPG image 600x400, resize it to 300x200, save it and the saved image is larger in size than the original image!

Reason for this is the lossy image compression of JPG: When saving an image in the JPEG format, one can set a quality level: 100% means, that the image is saved 100% exactly, no pixel will differ from the original when reopening the file. Any percentage less than 100% means that image information is lost due to the compression algorithm applied.

The compression algorithm can optimize best when it is applied the first time. Most JPEG images that one gets (from Internet, Digital cameras, Scanners) have been compressed with some loss, already.

Now, when resizing the image or even just saving it again, either the file is compressed again and image information is lost again, or the file size might remain almost the same, although the image is much smaller in pixel size.

The consequences:
- When saving an image with image loss (e.g. 50% JPG quality), image quality gets poorer each time the image is saved.
- If you intend to modify an image several times, do not use JPEG as intermediate format.

See also post "JPG LosslessTransformations"

Posted: Wed Nov 19, 2003 8:12 am
by Greg Martin
Ok, thanks. Now i go first change in options-write-jpg-quality to 60% and now my photos' size come smaller when i use resize.

But i think it would be good if in resize window it was possible to change quality? Or maybe same like in Photoshop which after save asks what kind of quality you like.

Posted: Fri Nov 21, 2003 6:08 am
by crazytb
Resize proccess is totally independent of save proccess. You may resize a JPG picture and save it as BMP or PNG. If you choose BMP, there will be no "quality options". If you choose PNG, the "quality options" will be different from JPG ones.

So, I think these options should stay like they are now.

Posted: Fri Nov 21, 2003 7:39 am
by helmut
Think the options should be displayed right before saving (as Greg proposed). With some formats like JPG and GIF, you often want to make a special setting per image:
For example in GIF files, you want to set the Transparent color and interlaced/non-interlaced. Making these settings in the general options or the colour dialog is too complicated and forgotten, often.

Posted: Mon Nov 24, 2003 6:43 am
by crazytb
Don't we have a button called "Options", just at side of "file type"? What is the problem with clicking there?

Posted: Mon Nov 24, 2003 9:33 pm
by helmut
crazytb wrote:Don't we have a button called "Options", just at side of "file type"? What is the problem with clicking there?
Right, there's the "Options" button in the "Save" dialog, this one is really helpful and directs to the appropriate options. But people might compress a file for the internet down to 30%. Two days later, they save another image and forget to change a setting and save their JPG image with that old 30% compression by accident.

To avoid this, showing a dialog with some options on it (e.g. quality for JPG files or transparency and GIF type for GIF files) could be helpful.

Posted: Wed Nov 26, 2003 4:59 am
by crazytb
I understand. So, if possible, would be a good idea to "extend" the save dialog to show the same options showed at Options dialogs.

Posted: Sat Nov 29, 2003 3:04 pm
by xnview
helmut wrote:To avoid this, showing a dialog with some options on it (e.g. quality for JPG files or transparency and GIF type for GIF files) could be helpful.
Yes, right. But the dialog will be so big :wink:
Pierre.

Posted: Sat Nov 29, 2003 4:14 pm
by helmut
xnview wrote:Yes, right. But the dialog will be so big
Sure enough, this should not be just one big save dialog, but more like a wizard, that means several dialogs or dialog pages after each other.

Posted: Wed Dec 03, 2003 5:50 am
by crazytb
helmut wrote:Sure enough, this should not be just one big save dialog, but more like a wizard, that means several dialogs or dialog pages after each other.
Wizard? Wizards aren't always good, because sometimes I cannot change all options at only one window. The first thing when I use WinZip is to select Classic style.

But... maybe... Add some small text area (just a label) to Save dialog, showing current quality settings for current image type, and a button to open a "normal" dialog to change these settings. This way, we will have the configuration at one click, and we will also have a "small" save dialog.

Posted: Tue Feb 27, 2007 8:53 pm
by helmut
Below a sample file which impressively shows how JPG compression can fail when re-saving a compressed JPG image:

Image saved with JPG compression (6 KB):
Image


Same image saved again with JPG compression (6 KB):
Image

Posted: Thu Mar 01, 2007 7:38 pm
by foxyshadis
The second one has a thumbnail and some IPTC junk, it looks like; the actual image data is only 3.1k. Like most programs, I usually have to run a jpeg optimizing step after saving in xnview. :(