Java creates anaglyph (red / blue image)

I am writing a Java engine ( http://victoryengine.org ) and I experimented with creating "3d" images with depth, you can see these red / blue glasses. I am using Java2D for graphics.

I created something that works, but very slowly (manually copying pixel values, etc.).

I need to take two BufferedImages (one for the left eye, one on the right) and combine them into one (either the other buffer, or directly on the screen). For one, I just want a red channel, and for the other, green and blue. What is the fastest way to do this?

+6
java graphics java-2d
source share
1 answer

Take a look at the JAI BandMerge operation:

http://download.java.net/media/jai/javadoc/1.1.3/jai-apidocs/javax/media/jai/operator/BandMergeDescriptor.html

Create your stereoscopic pairs as grayscale images and use channel combining to combine them as the red and green channels in the final image.

+3
source share

All Articles