So, what's the problem? The ideas of anaglyph generations are fairly simple, but there are some delicate moments related to vision. Learn the theory; it's also not very complicated. I've selected some academic materials for you:
http://www.ee.cuhk.edu.hk/~snli/Anaglyph_SPIC2013.pdf[
^],
http://www.alessandrofrancesconi.it/projects/anaglyphgenerator/ag_slideshow.pdf[
^],
http://icit.zuj.edu.jo/icit09/PaperList/Papers/Image%20and%20Signal%20Processing/578.pdf[
^],
http://cgit.nutn.edu.tw:8080/cgit/PaperDL/WSY_100506083318.PDF[
^],
http://www.vis.uni-stuttgart.de/uploads/tx_vispublications/stereo-main_01.pdf[
^],
http://www.academia.edu/7531567/3D_Image_Generation_from_One_Single_Image[
^],
http://3dtv.at/Knowhow/AnaglyphComparison_en.aspx[
^].
If this is not enough, you can find a lot of literature. After all, this is mostly the elementary stereo geometry. Consider two projections of a real 3D scene, on for one eye, another for another one, taking into account the distance between eyes. Model the mapping from to 3D to two 2D images, make then two semi-transparent monochrome images of two different colors. Match the model with the situation when a viewer uses a computer screen and color glasses.
See also this interesting CodeProject article:
Creating a 3D Image from a DepthMap[
^].
Sorry, the code is in C#, but 1) you need just to understand the algorithms, translating from C# is not a big problem; 2) you can use C# on Mac OS X through Mono, alternative open-source CLR implementation.
—SA