Results 1 to 5 of 5

Thread: Anaglyph - is it possible to preserve colors?

  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    Anaglyph - is it possible to preserve colors?

    Dear friends,

    you might noticed increased level of talk regarding various 3D technologies recently. There are multiple solutions available, like nvidia 3D glasses, special "3D" monitors and projectors.

    And then there is the good old anaglyph we've been playing in TBGL for some time. It provided nice illusion of depth, but the colors were just completely wrong. Also lot of talk over net cited impossibility to maintain colors with red cyan glasses.

    I was experimenting with this, wanted to break this color fidelity problem. I got some nice results, but then I realised ... somebody did this before me ... and better.

    Anyway this was nice challenge, and I present you here little program implementing algorithms from the mentioned source. It is application allowing to combine two images to one anaglyph.

    This is very nice task for ThinBASIC, as the script could take advantage of:
    • Calling function by name
    • Built-in matrix handling
    • Canvas and TImage module


    The first one is used for simple thing - all image processing functions start with "PA_", so I can automatically detect them from source and add them as option in the dialog automagically.

    Built-in matrix handling allows to perform quite fast per pixel operations.

    Canvas serves as display of the images, while TImage allows to load images of various formats.

    The script itself is far from perfect - it could use some speed tuning (I don't recommend images over 640x480 unless you have fast PC) and it seems the TImage module sometimes makes image "upside down".

    But I hope you will like this experiment, and maybe it will be you who will discover even better technique to maintain good level of color fidelity with anaglyph.

    The images you get with the script are photos taken by me using normal camera - you just shoot one frame, focusing on some point on the object, then shift the camera while still keeping the same part of object in focus and grab other frame. This should simulate view of left and right eye. I will appreciate any left-right images from you, as I think the mine do not demonstrate the 3D effect to the edge yet.

    Last word - the latest beta is a must to have for fast and proper execution of the script.


    Have fun,
    Petr
    Attached Images Attached Images
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  2. #2
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    52
    Posts
    944
    Rep Power
    111

    Re: Anaglyph - is it possible to preserve colors?

    super!

    I have tried and built my own horror scene but with a strandgirl
    the example works very fine! although I haven't 3d glasses it looks like a charming thing.

    it's possible for next release to save the rendered picture ? would be good idea.

    many thanks for this great example, petr. I like it!

    (sometimes I don't know clearly if I should use better canvas mode or tbgl for my scenes. some days ago I was looking for a chart diagram example like you can see at financial it companies uses for market-prices (dollar, pound, yen and so on...). so I will try to use in canvas mode. I am missing some more and new canvas examples )

    servus, many thanks for this great idea, franko lionheart
    Attached Images Attached Images
    you can't always get what you want, but if you try sometimes you might find, you get what you need

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,153
    Rep Power
    736

    Re: Anaglyph - is it possible to preserve colors?

    Hi Frank,

    thanks for the test

    When you need full quality:
    • Load image for left/right eye
    • Press "Full render"
    • After it is done, hit "Save"


    This way it will save the image at full resolution, and not just 320x240 preview one you can see. I produced this way the big image attached to the first post (I have rendered even 1280x960 with this program, but it takes time).

    The last render is saved automatically to file "___temp___.bmp"


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    68
    Posts
    3,865
    Rep Power
    405

    Re: Anaglyph - is it possible to preserve colors?

    Petr, as always... exciting area to be coding in and researching. Thanks for a cool program and example.

    Frank, nice subject for 3D!
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  5. #5
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    52
    Posts
    944
    Rep Power
    111

    Re: Anaglyph - is it possible to preserve colors?

    petr, I have only forgotten to "save" the rendered picture thanks for info!
    saved my strandgirl in my last post!

    frank
    you can't always get what you want, but if you try sometimes you might find, you get what you need

Similar Threads

  1. colors and console_printat
    By sandyrepope in forum Console
    Replies: 4
    Last Post: 22-02-2007, 17:59

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •