I started doing a deep dive on Spatial Photos in #visionos and had some fun. Both #iOS and #macOS now have badges in the Photos app that recognizes when a photo is a Spatial photo. Both also have a new category for Spatial photos (and presumably videos).
Each Spatial Photo appears to be a HEIC made up of two images, with each image having some metadata related to the Camera Intrinsics. The Position is slightly different between each photo, I suppose accounting for the IPD?
Here's the second photo in the HEIC, slightly varying Position data.
Spatial Photos also use a new XMP definition with the <SpatialMedia> type.
I tried creating my own HEIC with two images, applying the same metadata as I found in the sample Spatial Photo that's in the #visionOS simulator runtime, which is recognized on #visionOS (and iOS and macOS) as a Spatial Photo, but it crashes the Photos app in the visionOS simulator when I try to open it (the sample photo included with the simulator opens fine, however). Seems there's more to the individual images in the Spatial HEIC than meets the eye.
Finally succeeded in creating a Spatial Photo that works on the visionOS simulator!
@branfonk hey Brandon! Is this a trick you’d be willing to share? I’m trying to create my own spatial photos in code but the Simulator doesn’t like them. Thanks!!
@BenLumen Hey! Sure thing - sorry I don’t check in that often here, and just saw this. I’ll follow-up with a gist or code sample or something asap! I’m basically just taking the stock Spatial Photo that’s included in the visionOS simulator, copying all of its metadata, but applying my own left and right images as the base of the output HEIC. I’ll share something to you with more!
@branfonk wow that would be amazing. Thanks 🙏 I’m trying this myself - the Simulator shows it in Photos as spatial but it won’t load it fully. Happy to share my code too. Cheers
@BenLumen @branfonk hey! curious, did you have to do anything besides copying the metadata? I'm doing the same thing and it's recognized as a spatial photo, but the vision pro refuses to display it in 3d for some reason