Page 1 of 1
File size smaller after lossless rotation - normal?
Posted: Mon Dec 31, 2018 2:44 am
by Benrasi
Is it normal that the file size is smaller after doing a lossless rotation?
The original file has 5262 KB, after only 4308 KB.
I notice in the EXIF a different Sub-sampling, but a better one in the rotated file. From 2x1, 1x1, 1x1 --> 1x1, 1x1, 1x1
Thanks,
Ben
Re: File size smaller after lossless rotation - normal?
Posted: Mon Dec 31, 2018 7:40 am
by cday
Are you familiar with File > Format setting... > Write -- JPEG ?
It's rather hidden, but possibly the file has also been saved with a slightly lower Quality setting?
Re: File size smaller after lossless rotation - normal?
Posted: Mon Dec 31, 2018 12:43 pm
by Benrasi
I know the setting, but it should not influence the lossless - otherwise it would be the wrong name

- but to make sure I checked with a much lower save quality setting and it has no result on the described difference. Normal rotation and save is done with this setting, I approved.
Can anyone try to loosless rotate an image and check the file size ?
I'm running version 0.92 on Kubuntu Linux.
Re: File size smaller after lossless rotation - normal?
Posted: Wed Jan 02, 2019 11:13 am
by xnview
the data is not changed, only compression...
Re: File size smaller after lossless rotation - normal?
Posted: Mon Sep 05, 2022 10:38 pm
by fromorbonia
Hi - sorry silly question, same behaviour on v1.0 and v.1.02, a significant drop in file size using the "lossless rotation" tool.
I don't quite follow your reply "the data is not changed, only compression...". If the compression changes, then the images changes, and so the data has to change. I would expect "lossless rotation" to not change the file size at all?
Checking the file size is also a simple check to show I haven't accidently used the incorrect rotation tool (or done something else).
Thanks!
Re: File size smaller after lossless rotation - normal?
Posted: Thu Sep 08, 2022 10:13 pm
by helmut
xnview wrote: Wed Jan 02, 2019 11:13 am
the data is not changed, only compression...
Compression is more efficient and results in smaller file while keeping the image information identical - right, Pierre?
Re: File size smaller after lossless rotation - normal?
Posted: Mon Sep 12, 2022 9:22 pm
by fromorbonia
Thanks helmut - but JPEG isn't a lossless compression.
It would be great to get a confirmation of what is going on.
Re: File size smaller after lossless rotation - normal?
Posted: Mon Sep 12, 2022 9:31 pm
by helmut
fromorbonia wrote: Mon Sep 12, 2022 9:22 pm
Thanks helmut - but JPEG isn't a lossless compression.
It would be great to get a confirmation of what is going on.
JPEG lossless transformations rearrange the compressed data (DCT coefficients) without (re)compressing image data. Unlike saving a file in JPEG format these transformations are lossless.
Manul pages of jpegtrans provides interesting background information:
https://manpages.ubuntu.com/manpages/xe ... ran.1.html
Related topic:
JPEG Lossless question. Why is the file size smaller?
Re: File size smaller after lossless rotation - normal?
Posted: Wed Sep 21, 2022 7:00 pm
by XnTriq
XnView also
optimizes Huffman tables during lossless transformations.
Related:
Lossless flip/rotate
Re: File size smaller after lossless rotation - normal?
Posted: Wed Dec 07, 2022 6:47 pm
by esv
I see that lossless translation doesn't respect the Settings→Formats→Write→JPEG "Optimize Huffman table"
Even when it's off, the file size still changes.
I understand that by default this is a good option — you get free space for free

But it can also be confusing
So maybe to allay some concerns like those aired in the OP as it's indeed the easiest thing to check that the file size hasn't changed (and alternative methods require more knowledge) to maybe add an extra option specifically for the lossless rotations that would allow do toggle any optimizations and just produce the results identical to the jpegtran tool etc, so that if you rotate the original 4 times you'll get exactly the same file as the original and be certain without any doubt (and this certainty is sometimes more valuable than the space savings) that everything is wholesome and lossless!
Or at least respect the already existing option
Another idea: maybe on the first lossless rotation you could add a warning that optimizations are enabled but default, but don't produce any quality loss?
Re: File size smaller after lossless rotation - normal?
Posted: Fri Dec 09, 2022 3:30 am
by XnTriq
esv wrote: Wed Dec 07, 2022 6:47 pmI see that lossless translation doesn't respect the Settings→Formats→Write→JPEG "Optimize Huffman table"
Even when it's off, the file size still changes.
Hello esv (-:
XnTriq wrote: Sun Apr 10, 2016 1:45 amI'd like to request an option to prevent XnView from optimizing the Huffman tables during lossless transformations.
Re: File size smaller after lossless rotation - normal?
Posted: Fri Dec 09, 2022 6:21 am
by esv
upd: I've added a suggestion to the proper forum section about this
viewtopic.php?f=60&t=44412
Sorry, stopped scrolling at May 2016, so didn't see your message

(side note: wish there were a proper request tracker so I could just upvote/follow your existing request; meanwhile will create a new suggesting dedicated just to this to maybe help with this)
Re: File size smaller after lossless rotation - normal?
Posted: Fri Dec 09, 2022 12:30 pm
by XnTriq
esv wrote: Fri Dec 09, 2022 6:21 amupd: I've added a suggestion to the proper forum section about this
viewtopic.php?f=60&t=44412
Sorry, stopped scrolling at May 2016, so didn't see your message

(side note: wish there were a proper request tracker so I could just upvote/follow your existing request; meanwhile will create a new suggesting dedicated just to this to maybe help with this)
Very well written

Thank you!
I was looking for a forum software or an extension for phpBB a while back, but didn't find anything that fit the bill.
BTW: There's a
bug tracker.
Re: File size smaller after lossless rotation - normal?
Posted: Fri Dec 09, 2022 1:29 pm
by esv
Well, you can't really use that, as far as I understand, you can't even subscribe to a bug (no to mention file one or "like" someone else's)
XnTriq wrote: Fri Dec 09, 2022 12:30 pm
I was looking for a forum software or an extension for phpBB a while back, but didn't find anything that fit the bill.
Don't know much about various alternatives, but what about
Discourse? From seeing it on a few forums, it's pretty good, definitely better than this outdated phpBB