Some Panasonic cameras offer a feature to stack a 4k video sequence to one image internally in order to enhance the Depth-of-Field, which is useful in macro shots. My Sony camera didn’t offer this feature. However, I found out that Photoshop CC offers a very clever function to get it done yourself in post-processing.
Capturing the video
When capturing the video, make sure you set a short shutter speed (e.g. 1/500 second) to prevent motion-blur in your individual frames. Then, record video and pull your focus from front to back (or just slightly shift the camera from front to back).
Use the highest resolution available. 4k videos will result in 8 Megapixel images, while 1080p footage just give you an 2 MP image. Keep in mind that some resolution might be lost through image alignment or later cropping!
- Open Photoshop, go to File -> Import -> Videoframes as Layers…
- Select your video file from the camera
- In the dialog, I recommend to set a skip amount for frames. I usually just use about every 5th or 10th frame for better (and faster) results. I recommend to keep the amount of images as low as possible for faster computation (less than 10 images are recommended)
- You should now see a list of layers from your video
- may delete the first and last frame(s) if they don’t line up correctly, check for frames which are almost identical and delete them in order to keep the amount of layers as low as possible
- (Optional but recommended, align the images) Select all Layers and go to Edit -> Automatically align layers… The Auto mode usually works good
- Select all layers, go to Edit -> Automatically blend layers… and choose the mode “Stack”. Hit okay
- Now, it will take quite a while
The results are quite good, even when you just handhold your camera. But keep in mind that this process take quite a while. For my sample, I aligned+stacked from a 3 second clip about 8 frames, which took about 10(!) minutes on a i7-5930K, which is quite fast hardware. The general problem is that Photoshop doesn’t make use of multiple cores when stacking layers, which is really a dissapointment. You also need a lot of RAM, in my test, Photoshop happily took up to 4 GB just for itself. So having a PC with at least 8 GB will help a lot.
You can see that the result is not perfect, you sometimes see some issues especially at the edge of the frame. However, for a quick handheld video shot, I think it’s quite good.
For the sake of comparison, here is how the same scene looks like with just one frame, you can see that most of the leave is out-of-focus because of the shallow depth-of-field (although I used quite a small aperture):
One of the biggest downside is probably the limited resolution of your video, even with 4k you’re still limited to 8 Megapixels. Also, since video is usually just 8 Bit compressed, you don’t have much post-processing latitude especially in terms of dynamic range. Shooting with a Log Profile can help, but then again you’re limited to 8 Bit (at least on consumer cameras) which can quickly lead to banding.
An alternative would be to fire a sequence of images, but this only works if you’re on a tripod or you have a camera with a very fast Framerate (e.g. the Sony A6000 series has up to 11 FPS in Continous Burst, and the Sony RX100 V has up to 24 FPS).
Last but not least, also keep in mind that most video codecs do interframe compression which means they looking for differences between frames and make use of visual limitations, which means you may see artifacts in a still grabed from a video that you wouldn’t notice when viewing it).
Still, it’s a great way to get fast results and it’s fun to play with