Automatic Generation of split-depth GIFs

What is a split-depth GIF?

A split-depth GIF is a normal GIF with white lines edited into the GIF to give a 3D effect to the GIF. Some examples are given below.


catcatcat

You can find more of these type of GIFs at the split-depth GIF subreddit.


Why automate this?

In order to create this split-depth GIFs, the standard procedure is to create per-frame masks of pixels which should be in front of the white lines and ones which should be behind them. This is typically done through video editing software, e.g. Photoshop. My motivation was to see if this process could be automated using the latest computer vision techniques.


Show me some results!

Below are some sample results from my process.




How did you do this?

If you want the full details, please consult my final report for this project.

The process pipeline is roughly as follows :

  1. Detect and segment the moving object(s) in the GIF.
  2. For each frame pixel, estimate the distance of the pixel from the camera relative to the GIF scene.
    • We use a pretrained Deep Convolutional Neural Field to estimate the depth of each frame of the input GIF(s). Depth maps of some sample frames are shown below (Hotter colors = Further away).
    • cat

    • cat

    • cat
  3. Manually set the position and width of the white lines, as well as the reference distance above which the pixels of the moving object will be considered as foreground.
  4. If a frame pixel is not part of the moving object and is within the white lines, set it as white.
  5. For each pixel of the moving object(s) that is within the white lines, set it as white if its distance is below the reference distance.
20 Awesome Colors