1
\$\begingroup\$

I have two versions of a JPG photo. According to the metadata, one has been saved in Shotwell while the other one is probably the orginal. Both files have the same resolution, dpi, bit depth, color space and compressed bits per pixel.

The presumed original is 877.472 bytes, the other version is 853.994 bytes. An image diff showed no difference. How can this be?

\$\endgroup\$
7
  • \$\begingroup\$ Maybe the original have EXIF data? \$\endgroup\$ Aug 1, 2014 at 22:33
  • \$\begingroup\$ The only difference in the EXIF data is that in the category main IFD, the field Software contains "Shotwell 0.9.3" in one case and "1.400" in the other case. But (877472-853994 bytes) divided by 4 (bytes per UTF-8 char) results in at minimum 5869.5 chars difference. So that doesn't seem to be the main reason. \$\endgroup\$ Aug 1, 2014 at 22:46
  • \$\begingroup\$ Embedded thumbnail? \$\endgroup\$
    – mattdm
    Aug 1, 2014 at 23:35
  • 2
    \$\begingroup\$ Could be all sorts of stuff: metadata, padding or data that doesn't affect the display of the JPG itself. Also, even with lossless compression, different algorithms would produce different file sizes, but being lossless an image diff should show nothing. \$\endgroup\$
    – MikeW
    Aug 2, 2014 at 0:24
  • \$\begingroup\$ "4 (bytes per UTF-8 char)" UTF-8 is a variable-width encoding that requires between 1 and 4 bytes (strictly speaking, 8-bit sequences) to correctly encode a given Unicode code point. It can be generalized to encode any 31-bit sequence into up to 6 bytes. en.wikipedia.org/wiki/UTF-8#Description \$\endgroup\$
    – user
    Aug 2, 2014 at 16:03

1 Answer 1

0
\$\begingroup\$

If a jpeg has been resaved as another jpeg, the file size will always change because the image will undergo lossy compression. I.e. when you lose some information, the size of the file will change because the image is now a tiny bit different.

Did you apply any curves or levels to the image difference to exaggerate the difference between the two images?

\$\endgroup\$
4
  • \$\begingroup\$ First I used download.cnet.com/ImageDiff/3000-2192_4-10401778.html which showed that there was no difference, same with using the difference mode for layers in Gimp and applying curves and levels. \$\endgroup\$ Aug 2, 2014 at 1:58
  • \$\begingroup\$ Interesting- I'd have thought that you'd have seen something. \$\endgroup\$
    – JenSCDC
    Aug 2, 2014 at 2:03
  • 1
    \$\begingroup\$ Resaved JPEG compression will eventually converge at the same image every time (with the same settings). Probably around ten times, but fewer is conceivable. See photo.stackexchange.com/a/34192/1943 \$\endgroup\$
    – mattdm
    Aug 2, 2014 at 3:44
  • \$\begingroup\$ That's interesting- I wonder if the standard was designed so that the saved images would converge or if it was an accident of mathematics. \$\endgroup\$
    – JenSCDC
    Aug 2, 2014 at 4:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.