Pixel Envy

Written by Nick Heer.

An In-Depth Look at Depth

Stu Maschwitz — an actual photographer and filmmaker — tried the new Portrait camera mode on his iPhone 7 Plus and he’s amazed:

So don’t ask if Depth Effect is perfect. A better question is if its failures are distracting. And I have certainly taken some test photos where they are. But the funny thing about test photos is that there’s often nothing worth photographing in them, so you just stare at the problems. In my own testing, whenever I’ve pointed Portrait Mode at something I actually care about, the results have been solid.

That’s a good way of putting it. I still don’t think it’s enough to tempt me into using the bigger model full-time, but the results are very compelling. And, according to Maschwitz, it’s definitely not a simple gaussian blur that gets applied to the background:

To my eye, Apple’s blur is obviously not gaussian, or even gaussian-esque. It’s some kind of sharp-edged circular blur kernel, maybe computed at a lower spatial resolution than the final image, which would account for some of the softness — and the miraculous speed with which the iPhone 7 Plus can do the job.

This seems to have been more-or-less In his TechCrunch article previewing Portrait mode, Matthew Panzarino called it a gaussian blur, but the article was updated with a comment from Apple after publishing:

Once it has these nine slices, it can then pick and choose which layers are sharp and which get a gaussian blur blur effect applied to them. Update: On additional inquiry, Apple clarified for me that it is in fact not gaussian effect but instead a custom disc blur. This is a blur with a more defined, circular shape than gaussian blur. So if you’re one of the few that was hankering to know exactly what kind of blur was applied here, now you know.

I can’t find too much on the web about disc blurring, but this explanation from Matt Pettineo seems pretty good:

Samples of the original color render target are taken along a disc, with the radius of the disc based on the blur factor calculated from the depth texture. This can produce a more realistic bokeh effect, and also opens up the possibility to simulate the bokeh produced by various lens types.

In this context, the disc blur effect is being applied to a 3D render, but Apple’s application of it to photography likely utilizes a similar technique. Very clever, and far more realistic than an ultra-soft gaussian blur.