JPEG processing question

XnConvert Multi Platform - Windows, MacOSX, Linux

Moderators: XnTriq, helmut, xnview

NewbieJPEG
Posts: 4
Joined: Sun Aug 13, 2023 2:48 pm

JPEG processing question

Post by NewbieJPEG »

Hello!

I am new to image processing and only recently got to know XnConvert. The program is great. Thanks to the authors for their work!
I use it to add text to the corner of personal JPEG photos (a few words: date, author). My OS is Ubuntu 22.04. XnConvert 1.98.
But no matter how I experimented with the settings, the output file is always larger by an average of 30-40%.
The increased volume doesn't bother me.

Wikipedia says that "JPEG (like other lossy compression formats) is not suitable for compressing images in multi-stage processing, as distortion will be introduced into images every time intermediate processing results are saved."

My question, rather, concerns the principle of processing JPEG files.
Please tell me if I understand correctly that every time I open a any JPEG file for editing (even if I put an arrow in GIMP, add a couple of words of text in XnConvert), the program “rebuilds” the entire JPEG file every time? But you can't notice such changes by eye, except for a pixel-by-pixel comparison. I can only minimize the losses, and the larger file size is due to the fact that during the “reassembly” the program can add some redundant information, which, again, I will not notice with my eye.

Thanks in advance for your reply.
cday
XnThusiast
Posts: 3833
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: JPEG processing question

Post by cday »

Making small changes to a JPEG and resaving it normally shouldn't significantly affect the filesize, and in general quality loss is normally only likely to become noticeable when an image is resaved many times.

If you are seeing a significant increase in filesize, it is probably resulting from images being resaved with different save options, most likely a higher 'quality' value. Best to take a look at the Output tab Format and related Settings... being used. The Use estimated quality (when possible) option should normally avoid a large change in filesize either way.
NewbieJPEG
Posts: 4
Joined: Sun Aug 13, 2023 2:48 pm

Re: JPEG processing question

Post by NewbieJPEG »

cday wrote: Sun Aug 13, 2023 3:54 pm Please look at the screenshot of the settings.
Are they sufficient in the general case so that the overall image quality does not deteriorate? Since there are a lot of photos for different years and they have different characteristics.
Those settings should work well for general photographs, probably better than needed.

When 'estimated quality' can be used there should be little change in filesize after any normal editing; when it can't be used for some reason, the quality value set of 100 could result in significantly larger filesizes, for most purposes 85 or 80 should normally be sufficient.

If you still see significant increases in filesize, if possible post representative 'before' and 'after' files for examination.
cday
XnThusiast
Posts: 3833
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: JPEG processing question

Post by cday »

Apologies:

Due to an unidentified procedural error on my part, your previous post has been overwritten, and my response above has been posted under your username.

I think you should be able to follow my advice, though?
NewbieJPEG
Posts: 4
Joined: Sun Aug 13, 2023 2:48 pm

Re: JPEG processing question

Post by NewbieJPEG »

cday wrote: Sun Aug 13, 2023 5:03 pm Apologies:

Due to an unidentified procedural error...
It's all right, I understand you. Thank you very much!
User avatar
XnTriq
Moderator & Librarian
Posts: 6229
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: JPEG processing question

Post by XnTriq »

Related discussion: Adding text to JPEG images