Page 1 of 1

Lossless Rotation based on Exif / Size change

Posted: Mon Mar 05, 2018 11:17 am
by NicoPL
Hello,

I use the JPEG Lossless Transformation - Rotate based on Exif orientation field.
I select all the photos in one folder, and apply this transformation on every ones.

What I don't understand is:
- why there is a change of the size of the files that are rotated change whereas the height and the width are multiple of 8 pixels.
- why there is a change of the size of the files that are not rotated.

If there is a change of the file size, it means that their is a loss of data.

Thank you in advance !

Best

NicoPL

Re: Lossless Rotation based on Exif / Size change

Posted: Tue Mar 06, 2018 3:14 pm
by xnview
There is an optimization of huffman table so little change in size without loss

Re: Lossless Rotation based on Exif / Size change

Posted: Wed Mar 07, 2018 3:02 am
by NicoPL
Thanks for the answer.
When you say little, what's little?
The file size drops by more than 1Mo. For instance from 8.8 to 7.6 or 7.5 to 6.2Mo

Re: Lossless Rotation based on Exif / Size change

Posted: Fri Mar 09, 2018 8:48 am
by NicoPL
I did a new test. Two photos, one with the EXIF saying that it needs to be rotated, one already horizontal by nature.
The only changes in Exiftool are the following:

Photo that needed to be rotated
# Original
- File Size : 8.6 MB
- Orientation : Rotate 90 CW
- Y Cb Cr Sub Sampling : YCbCr4:2:2 (2 1)
# New file - Rotated
- File Size : 7.3 MB
- Orientation : Horizontal (normal)
- Y Cb Cr Sub Sampling : YCbCr4:4:0 (1 2)

Photo that didn't need to be rotated
# Original
- File Size : 7.7 MB
# New file - Not rotated
- File Size : 6.7 MB

I still can't understand why there is such a drop in file size.
Thanks in advance for your help. I really have to make sure that computing this operation doesn't alter the quality of my pictures.

Best

Re: Lossless Rotation based on Exif / Size change

Posted: Mon Mar 12, 2018 5:43 pm
by xnview
NicoPL wrote: I still can't understand why there is such a drop in file size.
Thanks in advance for your help. I really have to make sure that computing this operation doesn't alter the quality of my pictures.
The compressed data of JPEG data are not changed, only huffman table

Re: Lossless Rotation based on Exif / Size change

Posted: Tue Mar 13, 2018 2:29 am
by NicoPL
Thank you for your answer.

To summarize:

When asking xnview to perform a batch rotation based on the exif field, it rotates the photo if needed, and whatever the rotation it changes the Huffman's table. This update of the Huffman's table results in a 15% drop of the file size. Is that correct?

My camera is brand new. I assumed that Panasonic knew how to implement optimized codes in their chipsets and therefore am still surprised of such a drop... 15% is a lot.

Re: Lossless Rotation based on Exif / Size change

Posted: Thu Mar 29, 2018 12:44 pm
by xnview
send me the original & rotated files?