JPEG output file sizes much higher than XnConvert output file sizes

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: XnTriq, helmut, xnview

rystaman
Posts: 5
Joined: Sat Aug 03, 2024 10:09 am

JPEG output file sizes much higher than XnConvert output file sizes

Post by rystaman »

Hi all,

I want to make sure I'm not missing anything important here, but when completing the comparable actions in nconvert and xnconvert the file size that xnconvert exports is much smaller.

e.g. the following actions in xnconvert:

Image

and export settings

Image
Image

vs the following nconvert script (which has metadata removed)

Code: Select all

./nconvert -quiet -out jpeg -keepfiledate \
-o "FILE NAME HIDDEN" \
-ratio -rtype lanczos -rflag decr \
-dpi 300 \
-resize 6000 9000 \
-q 100 -opthuff -dct 2 -subsampling 0 \
-rmeta \
-rexifthumb -buildexifthumb \
"FILE NAME HIDDEN"
Gives almost a 15MB difference in file size:

Image

Am I missing something here?
cday
XnThusiast
Posts: 4135
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: JPG much higher file sizes than xnconvert

Post by cday »

The NConvert -q100 JPEG compression term (maximum quality) may be the explanation, your selected XnConvert JPEG output compression level isn't visable in your screenshots, click on the Output tab Format - Setting... button to see the set value, I suspect possibly 80...
rystaman
Posts: 5
Joined: Sat Aug 03, 2024 10:09 am

Re: JPG much higher file sizes than xnconvert

Post by rystaman »

cday wrote: Sat Aug 03, 2024 12:22 pm The NConvert -q100 JPEG compression term (maximum quality) may be the explanation, your selected XnConvert JPEG output compression level isn't visable in your screenshots, click on the Output tab Format - Setting... button to see the set value, I suspect possibly 80...
Thanks for the response, the output image was in the OP but might have just been missed. As you can see below I've copied all the relevant settings into my nconvert script including max quality but still get the discrepancy in file size, so not sure if xnconvert deploys better optimisation for output?

Image
cday
XnThusiast
Posts: 4135
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: JPEG output file sizes much higher than XnConvert output file sizes

Post by cday »

Sorry if I didn't look closes enough at your several images, a lot of settings, finite bandwidth and an expectation that the set quality values were a likely explanation. I assume on close inspection of all file info parameters no difference is discernible.

I currently have no other possible explanation, but 100% quality is rarely an appropriate JPEG output setting usually producing an unnecessarily large file size with in most practical situations no discernible increase in image quality when viewed compared to 90% or 80% quality. In the absence of other ideas, you might compare output file sizes and viewed image quality when a slightly lower quality is set, is the file size difference maintained; in my experience in many situations images with reasonably large pixel dimensions can often take surprising high compression without noticeable loss of image quality,

I also believe that image quality scales are not in general directly comparable between different softwares, but one would expect as in this case consistency within softwares produced by the same developer.
rystaman
Posts: 5
Joined: Sat Aug 03, 2024 10:09 am

Re: JPEG output file sizes much higher than XnConvert output file sizes

Post by rystaman »

I understand your points about JPEG quality settings, and I agree that 100% quality often results in larger files without significant visible improvement. However, since these images are intended for print, maintaining the highest quality is essential.

Even when reducing both to 80% I still get a 38% difference in file size

Image

Maybe the dev can lend some insight on if I’m missing anything or if there are some differences in the compression algorithms