Smaller image has same file size

Ask for help and post your question on how to use XnView Classic.

Moderators: XnTriq, xnview

Greg Martin

Smaller image has same file size

Postby Greg Martin » Tue Nov 18, 2003 5:45 pm

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 :?: :?: :?:

User avatar
helmut
Posts: 8116
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: Smaller image has same file size

Postby helmut » Tue Nov 18, 2003 9:26 pm

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"
Last edited by helmut on Tue Oct 10, 2006 12:10 am, edited 1 time in total.

Greg Martin

Postby Greg Martin » Wed Nov 19, 2003 8:12 am

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.

User avatar
crazytb
Posts: 124
Joined: Wed Oct 15, 2003 2:51 am
Location: Brazil
Contact:

Postby crazytb » Fri Nov 21, 2003 6:08 am

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.

User avatar
helmut
Posts: 8116
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Postby helmut » Fri Nov 21, 2003 7:39 am

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.

User avatar
crazytb
Posts: 124
Joined: Wed Oct 15, 2003 2:51 am
Location: Brazil
Contact:

Postby crazytb » Mon Nov 24, 2003 6:43 am

Don't we have a button called "Options", just at side of "file type"? What is the problem with clicking there?

User avatar
helmut
Posts: 8116
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Postby helmut » Mon Nov 24, 2003 9:33 pm

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.

User avatar
crazytb
Posts: 124
Joined: Wed Oct 15, 2003 2:51 am
Location: Brazil
Contact:

Postby crazytb » Wed Nov 26, 2003 4:59 am

I understand. So, if possible, would be a good idea to "extend" the save dialog to show the same options showed at Options dialogs.

User avatar
xnview
Author of XnView
Posts: 27548
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Postby xnview » Sat Nov 29, 2003 3:04 pm

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.

User avatar
helmut
Posts: 8116
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Postby helmut » Sat Nov 29, 2003 4:14 pm

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.

User avatar
crazytb
Posts: 124
Joined: Wed Oct 15, 2003 2:51 am
Location: Brazil
Contact:

Postby crazytb » Wed Dec 03, 2003 5:50 am

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.

User avatar
helmut
Posts: 8116
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Postby helmut » Tue Feb 27, 2007 8:53 pm

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

User avatar
foxyshadis
Posts: 370
Joined: Sat Nov 18, 2006 8:57 am

Postby foxyshadis » Thu Mar 01, 2007 7:38 pm

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. :(


Return to “Classic - General Support”

Who is online

Users browsing this forum: No registered users and 0 guests