File size smaller after lossless rotation - normal?
Moderators: XnTriq, helmut, xnview
-
- Posts: 6
- Joined: Wed Dec 05, 2018 5:56 pm
File size smaller after lossless rotation - normal?
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
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
-
- XnThusiast
- Posts: 4134
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: File size smaller after lossless rotation - normal?
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?
It's rather hidden, but possibly the file has also been saved with a slightly lower Quality setting?
-
- Posts: 6
- Joined: Wed Dec 05, 2018 5:56 pm
Re: File size smaller after lossless rotation - normal?
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.
Can anyone try to loosless rotate an image and check the file size ?
I'm running version 0.92 on Kubuntu Linux.
-
- Author of XnView
- Posts: 44461
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Re: File size smaller after lossless rotation - normal?
the data is not changed, only compression...
Pierre.
-
- Posts: 2
- Joined: Mon Sep 05, 2022 10:27 pm
Re: File size smaller after lossless rotation - normal?
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!
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!
-
- Posts: 8705
- Joined: Sun Oct 12, 2003 6:47 pm
- Location: Frankfurt, Germany
-
- Posts: 2
- Joined: Mon Sep 05, 2022 10:27 pm
Re: File size smaller after lossless rotation - normal?
Thanks helmut - but JPEG isn't a lossless compression.
It would be great to get a confirmation of what is going on.
It would be great to get a confirmation of what is going on.
-
- Posts: 8705
- Joined: Sun Oct 12, 2003 6:47 pm
- Location: Frankfurt, Germany
Re: File size smaller after lossless rotation - normal?
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.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.
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?
-
- Moderator & Librarian
- Posts: 6366
- Joined: Sun Sep 25, 2005 3:00 am
- Location: Ref Desk
-
- Posts: 43
- Joined: Fri Sep 16, 2022 1:04 pm
Re: File size smaller after lossless rotation - normal?
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?
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?
-
- Moderator & Librarian
- Posts: 6366
- Joined: Sun Sep 25, 2005 3:00 am
- Location: Ref Desk
Re: File size smaller after lossless rotation - normal?
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.
- Jpegcrop: Preferences and Options description
-
- Posts: 43
- Joined: Fri Sep 16, 2022 1:04 pm
Re: File size smaller after lossless rotation - normal?
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)
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)
-
- Moderator & Librarian
- Posts: 6366
- Joined: Sun Sep 25, 2005 3:00 am
- Location: Ref Desk
Re: File size smaller after lossless rotation - normal?
Very well written Thank you!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)
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.
-
- Posts: 43
- Joined: Fri Sep 16, 2022 1:04 pm
Re: File size smaller after lossless rotation - normal?
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)
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