Jump to content
Hash, Inc. Forums
John Bigboote

How to: Facebook's Depth images... and A:M

Recommended Posts

Hey- anyone noticed the 'depth images' that are all the rage on Facebook right now? Here is a instructional sheet (not mine) I found regarding how to do it, and of course my first thought is... we can do this in A:M really easily with the depth map render!

I am out the door for the weekend or I would whip one up... anyone else that wants to be the 1st- HAVE AT!!!

The Facebook depth effect is an image that as you scroll over it... on your phone or desktop, appears to have a multi-plane that is driven by your scroll. The image is built by Facebook as you load-up 2 images... your RGB color image and a depth greyscale image.

 

DepthDir.jpg

Share this post


Link to post
Share on other sites

Edit: see better A:M process in next post

If you know how to extract the depth map from an OpenEXR render and scale it into a PNG you are on your way already.

A perhaps more intuitive way is to temporarily set all the objects in your shot to full 100% ambient intensity white, no specularity.

Set your camera background to black, turn fog ON, and set the fog near and far distances to contain the nearest and farthest objects in your scene.

You should get a grayscale image approximation of a depth map.

Share this post


Link to post
Share on other sites

Here is a clear process, using the OpenEXR format.

Note that the screen capture compression makes the grayscale depth buffer look very banded. The actual render will be smooth.

Note, also, that my choice of only 640x640 for resolution was a weak one. Although the final image is seen rather small on Facebook, a higher resolution depth map seems to make the Facebook 3D process work better and make fewer mistakes about near v. far.


 

 

Thank you , Matt for finding this new FaceBook feature!

Share this post


Link to post
Share on other sites

I'll also note that you do need to have a solid modeled background in your image.

Even one just big patch to cover the background will be enough.

The default camera background is not able to create a proper depth map result.

Share this post


Link to post
Share on other sites

Thanks for the tutorial, Rob- good to know you can do this ALL right from A:M without a pitstop in Pshop/Gimp. You are correct in assuming most people will just see this on their phone, and these things are REALLY EYE-CATCHING as you scroll-thru FB and the depth parallax happens.

Share this post


Link to post
Share on other sites

FUN! I just grabbed a random photo (of my fav band the Stones) and painted my own depth map image following the near-is-white and far-is-black rule and the results are pretty eye-catching! Of course- I can't show it here, you have to see it on my Facebook page- what fun!

RS.png

RS_depth.png

Share this post


Link to post
Share on other sites

That's really cool! I gave it a go with and old cover to one of our graphic novels. You could easily spend many hours working on it. They definitely get your attention when your scrolling.

Share this post


Link to post
Share on other sites

The photo snapshot versions that we see on Facebook are done with the new cell phones that have two camera lenses. Internally it is taking a conventional stereo photo but then creating a depth map from that to apply the photo to. The process must be pretty smart since not every pixel of one view is going to have an easily identifiable counter part in the other.

i wonder if there is a way to get that depth map? For displacement mapping purposes.

There are some tutorials on the web for creating depth maps from stereo photos but I haven't investigated it.

Share this post


Link to post
Share on other sites

Yeah, that's how I first did it was with my iPhone. It's hit or miss, though. Some would figure it out, but if it was too complicated, you ended up with weirdness. In order to get Facebook to recognize it as a 3D photo, you had to use "portrait mode," which is what the iPhone uses to allow you adjust lighting and focus settings on a photo after it's taken. Presumably the phone is generating a depth map to accomplish this. 

Share this post


Link to post
Share on other sites

Could getting the depth map be as simple as finding a file with "*_depth.png" on your phone?

If that is what we are saving for our CG creations, that must be what the phone is saving as a file also?

Share this post


Link to post
Share on other sites

Not quite that simple. Apparently if you have a later OS than I have and the latest version of Photoshop, you can import the image from your phone (like importing images from your camera) and the depth map is in its own channel.

I've also seen an application that uses a command line to write them to a file.

Apple bought a company in 2015 that developed this process for using the two lenses to build a depth map. Assuming it still works the same way, it actually creates only 9 layers of depth and it obviously works better in some conditions than others. The image seems to be a much lower resolution one than the actual image, which isn't ideal.

There are iPhone apps that seem to let you isolate the depth map, but the two free ones I tried failed to work. 

I gather the iPhone X and XR are much better than the 8+ I have.

Share this post


Link to post
Share on other sites

Anyone with lots of free time.. I'd be curious to know if any of these schemes are productive...

depth map from stereo photos

 

 

I dimly recall reading that some of the digital cameras used for motion pictures now are recording a depth map channel which allows them to create and alter the 3D in post rather than have to get it right on the set with a dual camera rig.

 

Share this post


Link to post
Share on other sites
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...