Convert Microsoft Photo Face Regions into Standard XMP Face Regions

Started by Mario, July 24, 2023, 05:02:10 PM

Previous topic - Next topic

Mario

Many people use Microsoft Photo to "tag" their friend and family in photos with face annotations.
What they don't know is that data is not stored in the standardized XMP regions, but in a proprietary Microsoft XMP namespace. Which makes the data useless for IMatch and other software.

IMatch imports the proprietary face regions as part of the XMP data. It can be viewed, searched and used, like any other tag. But IMatch does not apply the special treatment to this proprietary data that it applies to standard XMP regions - namely converting the XMP regions into IMatch face annotations, using the associated tag to lookup the corresponding person etc. See Working with XMP Face Regions in the IMatch help for full details.

I have no idea why Microsoft would store the face regions in their own XMP namespace and in a format that differs a lot from the official XMP face regions. Windows Photo could just use the official XMP regions and it would work the same - with the added benefit that the data would also be available in software like IMatch or Lightroom.

Probably another customer lock-in strategy of sorts.
This is why I don't like proprietary metadata - it's never good for the customer, only for the software vendor.

The conversion between the proprietary Microsoft regions and the standard XMP regions is a bit difficult, because the structures are quite different. Nothing that could be done by simply copying metadata around using a Metadata Template or the Metadata Mechanic in IMatch. The conversion requires some "active" logic.

Thankfully, Phil Harvey from ExifTool created a solution for this particular problem. An ExifTool config file which converts the proprietary Microsoft face regions into standard XMP face regions. Awesome! Thanks, Phil.

If you want to make the proprietary Microsoft Photo face regions available for XMP-compliant software like IMatch, you can run ExifTool from the command line and let it convert the face regions.
IMatch afterwards rescans the modified files automatically and converts the XMP face regions ExifTool has created into proper IMatch face annotations, assigns person and all the good stuff.

How To Do It

Assuming
a) IMatch is installed on the PC and
b) the images you want to convert are in the folder c:\My Images:
c) the files have no pending write-back. Else write-back first in IMatch to avoid data loss.

  • Open a Command Prompt from the START menu (search for cmd and press <Enter>)
  • Use the cd command to set the current directory to c:\My Images:
    cd "c:\My Images"
  • Copy & paste this command line (all this is one line, don't add line breaks):
    "C:\Program Files\photools.com\imatch6\exiftool" -config "C:\Program Files\photools.com\imatch6\config_files\convert_regions.config" "-RegionInfo<MPRegion2MWGRegion" *.jpg

This command converts the MP face regions into XMP face regions for all .JPG files in the current directory.

ExifTool keeps a copy of the original file with the _original extension appended:
DSC01234.JPG => DSC01234.JPG_original

If you have verified that the modified images work, you can delete these backup copies.
If you don't want ExifTool to create these backup copies, add the -overwrite_original option to the above command line:

"C:\Program Files\photools.com\imatch6\exiftool" -config "C:\Program Files\photools.com\imatch6\config_files\convert_regions.config"
-overwrite_original "-RegionInfo<MPRegion2MWGRegion" *.jpg

Repeat these steps for all folders containing files with proprietary Microsoft Photo face regions.

Lesson to learn: Before you touch metadata in applications, make sure you understand where the data is stored and if you can access the data also in other applications. You don't want lock yourself in, after all.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook