Saturday, 26 September 2015

How to distinguish images compressed by Google Photos vs the original using metadata?


I used Google Takeout to download all of my photos from Google Photos and realized that Google compresses these images 2-3x to give me free storage. This is great, but a lot of my images are stored at original size. Unfortunately, both 'google-compressed' images and 'original-high quality' images are stored with the jpg extension. I am wondering how to figure out which is which? Does Google add metadata tags to identify if they have been recompressed?



Answer




Google does add some tags to images that it recompresses, including images stored as "High Quality", which may be downsampled to 16MP or less. Images stored at "Original" quality appear to be kept unaltered. At this time, the following tags appear to be added or altered:



  • XMPToolkit = XMP Core 5.5.0

  • ImageUniqueID


The following command may list images that have been altered by Google:


exiftool -if '($XMPToolkit =~ /^XMP\ Core\ [\.\d]+$/) \
and ($ImageUniqueID)' -s2 -q -FilePath -ext jpg .

Some caveates





  • The command may include images not altered by Google. Other programs may use the same, or similar, XMPToolkit strings that Google does, especially if they happen to use the same image-writing library that Google does. For instance, GIMP uses "XMP Core 4.4.0-Exiv2". Photoshop uses "Adobe XMP Core 5.3-c011 66.145661, 2012/02/06-14:56:27" (as noted by StarGeek).




  • The command may miss images altered by Google. This depends on how Google has changed their image processing over the years. For instance, it's not known (to me) when Google started using the ImageUniqueID tag. So some images may not have it set.




  • There are other tags that may be altered by Google, but they are not reliable to check because many JPEG images have them, including those straight from my camera (FujiFilm X-T20):




    • JPEGDigest

    • YCbCrSubSampling




Other options


You may also guess whether images have been altered by comparing file sizes or using tools like jpegjudge.


No comments:

Post a Comment

Why is the front element of a telephoto lens larger than a wide angle lens?

A wide angle lens has a wide angle of view, therefore it would make sense that the front of the lens would also be wide. A telephoto lens ha...