Are you curious about the tech and the algorithms behind the feature? Let’s check out a post by a Medium user akella.
For users it’s quite simple: use portrait mode on iPhone and them post the photo to Facebook. How does it work? The enthusiast from Medium states that when new iPhone is taking a picture in portrait mode, the device also stores depth data along with usual .jpg. Check out a little video explanation on how gathering the data below:
It is worth noting that this data comes as a point cloud, not a mesh. Then, Facebook creates an actual 3D model out of it with a photo as a texture using some interpolation algorithm.
When a user loads a facebook page, it opens a scene and loads the created model with a texture.
Camera position is changing as you move your mouse, so you experience this 2.5D effect, which is actually a true 3D model as it turns out. Make sure to read the original article with more details here.