Adjust-Automatic Levels / filesize

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

Moderators: XnTriq, xnview

Post Reply
mrwul
Posts: 226
Joined: Tue May 25, 2010 7:01 pm

Adjust-Automatic Levels / filesize

Post by mrwul » Sat Apr 09, 2011 12:46 pm

It strikes me when I apply 'Adjust->Automatic Levels', the filesize increased by more than 2x
Examples

Code: Select all

Name                           Size on Disk
bla bla-07042011 135755.JPG    2.842.624
bla bla-07042011 135715.JPG    3.125.248
bla bla-07042011 125709.JPG    6.565.888 *
bla bla-07042011 125637.JPG    7.159.808 *
bla bla-07042011 124050.JPG    7.348.224 *
bla bla-06042011 175958.JPG    6.971.392 *
bla bla-06042011 175703.JPG    2.912.256
bla bla-06042011 175505.JPG    3.117.056
bla bla-06042011 175210.JPG    3.698.688

* files that have been 'adjusted'.

TIA
=

User avatar
JohnFredC
XnThusiast
Posts: 2010
Joined: Wed Mar 17, 2004 8:33 pm
Location: Sarasota Florida

Re: Adjust-Automatic Levels / filesize

Post by JohnFredC » Sat Apr 09, 2011 1:47 pm

Your settings for Save JPG are probably different than those of the original files.

Go to Tools->Options->Read/Write->JPEG to make adjustments.
John

mrwul
Posts: 226
Joined: Tue May 25, 2010 7:01 pm

Re: Adjust-Automatic Levels / filesize

Post by mrwul » Sat Apr 09, 2011 5:55 pm

Hi

My settings
Image

Am not sure though whether there is anything wrong there ... :?

User avatar
JohnFredC
XnThusiast
Posts: 2010
Joined: Wed Mar 17, 2004 8:33 pm
Location: Sarasota Florida

Re: Adjust-Automatic Levels / filesize

Post by JohnFredC » Sat Apr 09, 2011 8:30 pm

You see that "Best" setting on the Quality slider in the dialog? That controls how much compression the JPEG algorithm uses when saving the file. "Best" means the lowest compression = the largest file size.

Keep in mind that the JPEG file format is a "lossy" file format: parts of your image (color quality, detail, etc) are thrown away in order to make the file smaller.

You should experiment with what position of the slider gives the best relationship between filesize and image quality for your own purposes.

Look at XnView's File->Export dialog and play around a bit.

Naturally, this topic has been discussed frequently in the past here in the XnView forum and there is much more material on the web, too.
John

mrwul
Posts: 226
Joined: Tue May 25, 2010 7:01 pm

Re: Adjust-Automatic Levels / filesize

Post by mrwul » Sun Apr 10, 2011 4:36 am

Thanks again.

Am sorry, but am no expert on this.

My (non-expert) assumption... was/is that a 'reworked' JPG cud not be 'better' than the original.
After all, after (each) saving, some details are gone.

Therefore, my 2nd assumption was that 'Best' would then result in roughly the same file-size as the original, i.e.
if I were to shift the slider to -say- 80% or so, I thought it would have a major impact on quality and size.

Oh, btw, I vainly tried to find a thread on subject 'Adjust' and (file) 'size'.

=

marsh
XnThusiast
Posts: 2443
Joined: Sun May 15, 2005 6:31 am

Re: Adjust-Automatic Levels / filesize

Post by marsh » Sun Apr 10, 2011 6:43 am

- Save JPG At 'Original' Quality (more about original vs. re-saves)

User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Re: Adjust-Automatic Levels / filesize

Post by Drahken » Mon Apr 11, 2011 9:33 am

My (non-expert) assumption... was/is that a 'reworked' JPG cud not be 'better' than the original.
After all, after (each) saving, some details are gone.
The thing is, as far as the program knows you're saving a brand new image with incredible detail, or maybe you added a lot of highly detailed stuff to the pic. The program isn't psychic, it relies on the user to decide such things.

That being said, if you check the "estimate quality" box on that dialog, the program will do it's best to guess, although it will still be somewhat larger than the original.

What you should do is this: Open the original image, do nothing to it, then go file->export & select the JPG tab. While on this box, move the slider until the output filesize matches that of the original file (or reasonably close to it). Now keep that percentage in mind & go to the normal save dialog & set it's slider to the same percentage. Now save a copy of the unedited pic & you should see that it's the same filesize.
Once you have that done, make your edits & save the edited pic with the same settings you just used. NOW compare the filesize of your edited pic against that of the original.



Lastly, keep in mind that your edited pics will almost certainly be of a somewhat different size than the original (although 2x is way more than normal). Adjusting levels can change the ammount of data in the image (ie by lightening some shades of grey until they are equal to the white elements of the pic). Even if the ammount of actual data doesn't change, the way that it is positioned in the pic can alter the efficiency of the compression alogrithms (ie, if you wound up sharpening some edges, those won't compess as efficiently as more blurred edges will).
Oh the feuhrer, oh the feuhrer, oh the feuhrer's nipples bonk!

User avatar
XnTriq
Moderator & Librarian
Posts: 5407
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Adjust-Automatic Levels / filesize

Post by XnTriq » Mon Apr 11, 2011 8:00 pm

Drahken wrote:That being said, if you check the "estimate quality" box on that dialog, the program will do it's best to guess, although it will still be somewhat larger than the original.
The problem with this setting ...
  • Tools » Options » General » Read/Write » Write » JPEG » Parameters » Use estimated original quality if possible
... is that XnView only takes the compression level (“Q factor”) into account, ...
Calvin Hass ([url=http://www.impulseadventure.com/photo/jpeg-compression.html]JPEG Compression, Quality and File Size[/url] » Where does the error come from?) wrote:By far the biggest contributor to the error (ie. file size savings) in the JPEG algorithm is the quantization step. This is also the step that allows tuning by the user. A user may choose to have a slightly smaller file while preserving much of the original (ie. high quality, or low compression ratio), or a much smaller file size with less accuracy in matching the original (ie. low quality, or high compression ratio). The tuning is simply done by selecting the scaling factor to use with the quantization table.
... but ignores other criteria such as chroma sub-sampling.
Calvin Hass ([url=http://www.impulseadventure.com/photo/jpeg-compression.html]JPEG Compression, Quality and File Size[/url] » Where does the error come from?) wrote:The act of rounding the coefficients to the nearest integer results in a loss of image information (or more specifically, adds to the error). With larger quality scaling factors (ie. low image quality setting or high numbers in the quantization table), the amount of information that is truncated or discarded becomes significant. It is this stage (when combined with the Run Length Encoding that compresses the zeros) that allows for significant compression capabilities.

There are other contributors to the compression error, such as the color space conversions, but the quantization step is the most important.
IMHO, the default settings should be:
  • Optimize Huffman table = activated
  • DCT Method = Float (best but slowest)
Someone correct me if I'm wrong ;-)
Gordon Richardson (Photo.net » Learn About Photography » Jpeg Compression » [url=http://www.photo.net/learn/jpeg/index.html#qual]Jpeg Quality Settings[/url]) wrote:Typically the only thing that the user can control in Jpeg compression is the quality setting (and rarely the chroma sub-sampling). The value chosen is used in quantisation stage above, where less common values are discarded by using tables tuned to visual perception. This reduces the amount of information while preserving the perceived quality. Chroma sub-sampling settings are dealt with separately (below).

Ranges of quality settings differ in each implementation, but the IJG values range from 99 (best) to 1 (worst). Please note that these are not percentages, nor is there a direct correlation with the final file size. The example at the top of the page uses an IJG quality setting of 50, and has a file size ratio of roughly 20:1. Anytime you read that an image has been compressed with 10:1 Jpeg quality, you should know that this is slightly misleading (see digital cameras below).

Jpeg is a discrete algorithm, and for a given quality setting different input images may give widely differing file sizes. An image with lots of texture and fine detail will produce a large Jpeg file, while one consisting only of blue sky will be very small. Chosing an appropriate Jpeg quality setting is a subjective decision, with no hard rules. I personally use IJG quality settings of 75 to 50 depending on the subject.

Post Reply