movie-fleur 🌻
Convert 3D movies with split frames to Anaglyph 3D movies for viewing with red (blue/cyan/green) 3D glasses.
Convert from Video File with Frame Position
If a 3D video is available, frames can be extracted by specifying the frame position. 3D video files can be
found here.
BufferedImage frame = FleurVideo.extract(new File("3dVideo.mp4"), 6000);
List<BufferedImage> splited = Fleur3dUtil.split(frame);
BufferedImage frameCombined = FleurFilter.additive(
FleurFilter.color(splited.get(0), ColorMask.RED),
FleurFilter.color(splited.get(1), ColorMask.CYAN));
ImageHelper.saveImage(frameCombined, "frame_combined.png");
Steps to Convert

FleurVideo.extract(new File("3dVideo.mp4"), 6000);
2. Split and Stretch Frames
Left Frame | Right Frame |
---|
 |  |
List<BufferedImage> splited = Fleur3dUtil.split(frame);
3. Combine Frames without Color Filtering

BufferedImage combined = FleurFilter.alphaCombine(frame1, frame2);
4. Apply Color Filters
Left Frame with Red Filter | Right Frame with Cyan Filter |
---|
 |  |
BufferedImage redFilterImg = FleurFilter.color(splited.get(0), FilterColor.RED);
BufferedImage greenBlueFilterImg = FleurFilter.color(splited.get(1), FilterColor.CYAN);
5. Combine Frames with Additive Filtering

BufferedImage additiveCombinedFrame = FleurFilter.additive(
FleurFilter.color(splited.get(0), FilterColor.RED),
FleurFilter.color(splited.get(1), FilterColor.CYAN)
);
6. Compile to Video

List<BufferedImage> images = FleurVideo.extract(new File("3dVideo.mp4"), 6000, 6010);
List<BufferedImage> videoImages = new ArrayList<>();
for (BufferedImage image : images) {
List<BufferedImage> splits = Fleur3dUtil.split(image);
videoImages.add(FleurFilter.additive(
FleurFilter.color(splits.get(0), ColorMask.RED),
FleurFilter.color(splits.get(1), ColorMask.CYAN)
));
}
FleurVideo.create(videoImages, "3dVideoOut.mp4");
7. Compile to Polarized 3D Video (Left/Right)
Left Video | Right Video |
---|
 |  |
List<BufferedImage> images = FleurVideo.extract(new File("3dVideo.mp4"), 6000, 6100);
List<BufferedImage> leftArray = new ArrayList<>();
List<BufferedImage> rightArray = new ArrayList<>();
for (BufferedImage image : images) {
List<BufferedImage> splits = Fleur3dUtil.split(image);
leftArray.add(splits.get(0));
rightArray.add(splits.get(1));
}
FleurVideo.create(leftArray, "left.mp4");
FleurVideo.create(rightArray, "right.mp4");
To view: play both videos on separate projectors or use active shutter 3D glasses on a 60Hz monitor.
Further Filters
Filter Name | Example | Code Snippet |
---|
Default |  | Default rendering |
Additive Blue Yellow |  | FleurFilter.additive(FleurFilter.color(splits.get(0), ColorMask.BLUE), FleurFilter.color(splits.get(1), ColorMask.YELLOW)); |
Additive Green Magenta |  | FleurFilter.additive(FleurFilter.color(splits.get(0), ColorMask.GREEN), FleurFilter.color(splits.get(1), ColorMask.MAGENTA)); |
Indexed |  | ImageHelper.convertToType(frame, BufferedImage.TYPE_BYTE_INDEXED) |
Red |  | FleurFilter.color(frame, ColorMask.RED) |
Green |  | FleurFilter.color(frame, ColorMask.GREEN) |
Blue |  | FleurFilter.color(frame, ColorMask.BLUE) |
Cyan |  | FleurFilter.color(frame, ColorMask.CYAN) |
Gray |  | FleurFilter.gray(frame) |
Binary |  | ImageHelper.convertToType(frame, BufferedImage.TYPE_BYTE_BINARY) |
Transparent (0.5) |  | FleurFilter.transparent(frame, 0.5) |
Invert |  | FleurFilter.invert(frame) |