Page 1 of 15 1234511 ... LastLast
Results 1 to 10 of 141

Thread: Chroma - a laser color blender

  1. #1
    Join Date
    Jan 2008
    Location
    Stockholm, Sweden
    Posts
    799

    Thumbs up Chroma - a laser color blender

    Having put a few more hours into this little project I feel it has reached a point where it might be worthy of its own thread.

    What is Chroma? Well, it is a tool for calculating the chromatic coordinates of mixtures of monochromatic light and displaying them in a CIE xy chromaticity diagram. Simply put, it answers the question: If I mix these lasers, what color will I get?

    It should be a very useful tool to consult when designing and building laser projectors, especially if lasers of more exotic wavelengths for which there is a lack of guidelines are involved. Systems of different wavelengths and powers can easily be evaluated for luminance and white balance.

    Capabilities of the program:

    • Calculate the CIE xyY coordinates for a mixture of up to 100 monochromatic sources using the Judd-Vos (1975) color matching functions.
    • Display the chromatic coordinates and gamut of the system in a zoomable CIE xy chromaticity diagram in sRGB using D65 as the white point.
    • Print or save diagrams in a large number of formats (including JPEG, PNG, PDF and Illustrator).

    Limitations:

    • Wavelengths are limited to 380 to 825 nm with 1 nm resolution (spline interpolated from 5 nm).
    • The chromaticity diagram is converted to sRGB, which means that most colors are outside of its gamut (and thus not correctly displayed). Keep in mind that most computer displays can't even display the whole sRGB gamut.
    • The calculated chromatic coordinates are only completely accurate for a beam reflected off a perfectly white surface. Viewing a beam in particle-free air will yield a different color due to strongly wavelength dependent Rayleigh scattering. In fog or haze the deviation will be far smaller as Mie scattering is only weakly wavelength dependent.
    • Requires MATLAB Compiler Runtime (MCR) 7.9 to run.

    Installation instructions:
    If you have MCR 7.9 installed already, you only need the small executable. In any other case you will need the large file (250 MB), which contains an installer for MCR 7.9. Download the required executable from here to the directory you wish to run it from. Run the exe you downloaded (and follow the installation instructions if you need to install MCR).

    I have rewritten a significant portion of the code since the previous release. In particular the code for the colors of the chromaticity diagram has been completely rewritten to produce a far more accurate diagram.

    I have attached a screenshot so you can easily see how the program has improved.

    Download mirror:
    http://tocket.mine.nu/Chroma/
    Attached Thumbnails Attached Thumbnails chroma.png  

    Last edited by tocket; 03-29-2010 at 05:28.

  2. #2
    Join Date
    Aug 2008
    Location
    UK
    Posts
    5,704

    Default

    I can't test at the moment Tocket as I'm half way through a large video render but will do so ASAP.

  3. #3
    Join Date
    Dec 2008
    Location
    Vezon, Belgium
    Posts
    1,017

    Default

    looks like this will do its little revolution in our world of DIY laser combining

    great job you did there

    is this matlab, or python matplotlib? I can recognize GTK2 or wxwidgets style

  4. #4
    Join Date
    Jan 2008
    Location
    Stockholm, Sweden
    Posts
    799

    Default

    Thank you. It is written in MATLAB. It is a very nice language for this kind of stuff, but unfortunately the standalone applications require the huge MCR engine to run.

    It would be nice to have it ported to another language, but I fear that it would be quite a large project to retain all the functionality in doing so without spending weeks programming. Besides, the only language I can program GUIs for is MATLAB.

  5. #5
    Join Date
    Aug 2008
    Location
    UK
    Posts
    5,704

    Default

    Hi Tocket,

    New version runs OK. Like the zoom feature in the pop up window.

    Not had time to play yet.

    Found 2 slight issues though:

    1. CMD prompt window stays open whilst Chroma is running

    2. It creates a Microsoft Office Table File Shortcut on the desktop called ciexyzbg. If you delete this shortcut (which only takes you to an Office info page) then Chroma goes through 1 st run procedure again.

  6. #6
    Join Date
    Dec 2008
    Location
    Vezon, Belgium
    Posts
    1,017

    Default

    @tocket:

    there is in fact a free open-source alternative for matlab: the pylab/scipy/numpy/matplotlib libraries for python

    all are free and python is a really nice, simple and easy language, with a really fast learning

    I use matlab and python/matplotlib at work to render satellite maps (gases concentrations and the like), and I have to say that I'm quite only making my figures with matplotlib now as they are nicer to the eye (and because it is open source)

    python also allows to compile your code and make EXEs to redistribute them, or either use the script with python as an interpreter

    GUIs are easy too, with access to many interface types

    the most interesting thing is that the code would be cross-platform

  7. #7
    Join Date
    Jan 2008
    Location
    Stockholm, Sweden
    Posts
    799

    Default

    I actually have some programming experience in Python as the course in applied programming I took was given in that language. I know for example string handling is excellent in python, but MATLAB has always been my choice for programming involving maths. Still, python sounds interesting if it can easily do what I want.

    Do you have any recommended literature for python GUI programming?

    Quote Originally Posted by White-Light View Post
    1. CMD prompt window stays open whilst Chroma is running
    Well, some useful information (as well as any errors) is printed in it. I have no idea how to get rid of it, but I think it's nice.

    Quote Originally Posted by White-Light View Post
    2. It creates a Microsoft Office Table File Shortcut on the desktop called ciexyzbg. If you delete this shortcut (which only takes you to an Office info page) then Chroma goes through 1 st run procedure again.
    It is actually a binary MATLAB formatted file containing the background image which is rendered at first run. Since it takes a while to generate it I thought this solution would be the best. It is also possible to embed it in the exe, but that would make it significantly larger. Anyway, this file is created in whatever directory Chroma is in, so just put the exe somewhere else and create a link to it on the desktop instead.

  8. #8
    Join Date
    Dec 2007
    Location
    Nottingham, UK
    Posts
    2,845

    Default

    That software is really quite good!
    I've been playing around with a few options to see what sort of powers I'd need as my build progresses and attached a few screenshots.

    Chroma1.jpg shows what I'll have initally. Look how much of the green/blue spectrum I'm missing!

    Chroma2.jpg shows when I add 150mW of 473nm (but I have to bump the 660nm red upto 0.9W! )
    So I then swapped that out for 250mW of 635nm and it's perfect (Chroma3.jpg)
    Sad thing is, my green is 300mW, and will have to be throttled right down (but I knew that when I bought it - good for non-balanced things I guess then!)

    Tocket: Fantastic piece of software. Dead useful for planning
    Just one thing: Would it be possible to get it to solve the ideal colour powers if say you fix one colour variable. e.g. have a fixed amount of 473nm and out pop the appropriate mW power values for the other wavelengths for that perfect white?

    Ta,
    Dan
    Attached Thumbnails Attached Thumbnails Chroma1.jpg  

    Chroma2.jpg  

    Chroma3.jpg  


  9. #9
    Join Date
    Dec 2008
    Location
    Vezon, Belgium
    Posts
    1,017

    Default

    @tocket:

    the matplotlib library has in fact all which is needed to plot everything like matlab

    it is to be installed with the scipy/numpy libraries which have everything needed to do scientific computation

    the two are really nice, and really close to matlab language

    for python GUI programming, I cannot point some lectures to you, but rather recommand what you could find on google about python with GTK+ or python with WxWidgets as both the subjects are well discussed in the open-source community

    also, compiling python to exe, as you surely know, would intensely reduce the size of your resulting package (especially if the user already have python installed )

  10. #10
    Join Date
    Jan 2008
    Location
    Stockholm, Sweden
    Posts
    799

    Default

    Something that deserves to be mentioned more than once is that the power you enter into the program needs to be the actual power coming out of your projector, after all optics!

    You can enter mathematical expressions into the fields in the program however, so if you're planning your build you could for example write 0.95*0.95*0.98*0.98*0.98*0.5 for a 500 mW green passing through 2 dichros (with 5% loss for each), bouncing off 2 98% reflective galvo mirrors and finally passing through an AR coated piece of glass. Perhaps I make the power input field wider to facilitate this.

    Quote Originally Posted by danielbriggs View Post
    Fantastic piece of software. Dead useful for planning
    Just one thing: Would it be possible to get it to solve the ideal colour powers if say you fix one colour variable. e.g. have a fixed amount of 473nm and out pop the appropriate mW power values for the other wavelengths for that perfect white?
    Glad to hear that you like it. I had already written the code to optimize mixtures towards a given white point, but I have not yet figured out how to implement it into the GUI. It can easily be made to work with mixtures of only 3 lasers, but I want to integrate it nicely into the GUI, which supports up to 100 lasers. The solution to these optimization problems can either be a single number, multidimensional function or non-existant, depending on what parameters you supply. I have summarized the solutions for commonly used wavelengths in this table though:


    It was first posted in another thread, where it's also explained how to use it.

Posting Permissions

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