Anaglyph 3D creates anaglyphs for photos, Live Photos and videos by generating stereo image pairs from depth prediction. Two photos taken with a slight horizontal offset—mimicking human vision—form a stereo image pair. When viewed with special glasses, Virtual Reality headsets, or free-viewing techniques like cross-eye or parallel viewing, this offset allows the brain to perceive depth, creating a 3D effect. An anaglyph combines the left and right images of a stereo pair into a single image, creating a 3D effect when viewed with red-cyan glasses. Specifically, the left image is represented in shades of red, while the right image appears in shades of cyan. The color-matching lenses ensure that each eye receives the correct image, enabling depth perception. Traditionally, a stereo pair is captured with a dual lens or double shot camera, as in our app Cameranaglyph. This app offers an alternative approach, using a single image to generate a stereo pair from depth prediction and machine learning. Machine learning is a process where computers analyze data to make predictions without being explicitly programmed for each task. It employs a model to detect and analyze patterns within the data. Training involves optimizing the model by iteratively adjusting its parameters using labeled data to minimize prediction errors and improve performance. One application of machine learning is depth prediction in images, where the model estimates how far objects are from the camera. By training on millions of images, the model learns to recognize visual patterns that indicate depth. A depth map represents object distances by encoding them as grayscale pixel values. Using machine learning, it’s possible to predict depth from a single photo or video frame, creating a depth map. By converting this depth map into disparity, a simulated stereo pair can be generated, which can then be used to create an anaglyph. Select a photo or video using the browser or from the sample media in the app menu. This app handles three media types—Images, Live Photos, and Videos—each of which is processed in its own specialized view to generate the anaglyph. Anaglyphs are generated using stereo image pairs generated from depth prediction. But if the media is spatial the app may use the stereo pair embedded within it to create the anaglyph. Anaglyph generation is accompanied by progress display. Generating a video anaglyph from depth prediction can be time consuming, depending heavily on the hardware support for it. For a conventional video stereo pairs are generated from depth prediction on the single image extracted from a video frame. Each stereo pair is then used to generate three types of video output—Anaglyph, Side by Side and Spatial—as follows: Anaglyph: Each output video frame is an anaglyph created using a stereo image pair generated from depth prediction on the input video frame. The resulting video should then be viewed with red-cyan 3D glasses. Side by Side: Each output video frame is a juxtaposition of the images using a stereo image pair generated from depth prediction on the input video frame. The placement of images is intended for parallel viewing. To see the 3D effect, the viewer must train their eyes to focus as if looking at a distant object, allowing each eye to align with the corresponding image. Spatial: Each output video frame consists of a stereo image pair generated from depth prediction on the input video frame to create a spatial video. A spatial video is a stereoscopic 3D video format introduced for the Apple Vision Pro. The Disparity Intensity parameter adjusts the pixel shift between the left and right stereo images generated from depth prediction. Increasing the value exaggerates depth differences, enhancing the 3D effect, while decreasing it reduces the disparity for a more subtle stereo effect — similar to adjusting contrast in an image.