Page 1 of 3 123 LastLast
Results 1 to 25 of 72

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 Images Attached Images
    Last edited by tocket; 03-29-2010 at 09:28.

  2. #2
    Join Date
    Aug 2008
    Location
    Yorkshire, UK
    Posts
    3,211

    Default

    I can't test at the moment Tocket as I'm half way through a large video render but will do so ASAP.
    They say video games are bad for kids but if Pacman had affected us we'd all be running around in dark
    rooms, munching pills and listening to repetitive music.

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

    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
    Yorkshire, UK
    Posts
    3,211

    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.
    They say video games are bad for kids but if Pacman had affected us we'd all be running around in dark
    rooms, munching pills and listening to repetitive music.

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

    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
    Warrington, UK
    Posts
    1,778

    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 Images Attached Images

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

    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.

  11. #11
    Join Date
    Jan 2008
    Location
    Belgium
    Posts
    972

    Default

    Where can I get this? I don't see a link

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

    Default

    The word "here" is linked in the original post, but since the theme of the boards changed links are the same color as normal text, which makes them very hard to see. I'll update the post.

    Here's the link again anyway:
    http://blue.orgchem.kth.se/Chroma/distrib/

  13. #13
    Join Date
    Dec 2007
    Location
    England, Hertfordshire
    Posts
    333

    Default

    Chroma.exe doesn't run and the other file is 256mb big...
    DL - Viper 75mW - Green (532nm)
    DL - 50mW Module - Green (532nm)
    DIY - 50mW - 12k Scanner - Green (532nm)

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

    Default

    Yes, look at the installation instructions in the first post.

    The server is very fast though; I download the file in just 40 seconds.

  15. #15
    Join Date
    Aug 2008
    Location
    Yorkshire, UK
    Posts
    3,211

    Default

    Quote Originally Posted by lamborgini8 View Post
    Chroma.exe doesn't run and the other file is 256mb big...
    If it doesn't run you need the big file as it contains the Matlab software re distributable needed to run it.
    They say video games are bad for kids but if Pacman had affected us we'd all be running around in dark
    rooms, munching pills and listening to repetitive music.

  16. #16
    Join Date
    Dec 2008
    Location
    veenwouden
    Posts
    1,440

    Default

    doc here at pl suggested the croma also zoof suggested it at the harlem meet and i just want to say that is really awesome. thanks tocket you with out a doubt Mr Color at PL

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

    Default

    I'm glad to see my program come to use.

    I have done some thinking about the algorithms used and so far I can only come to the conclusion that they are good the way they are. It uses more recent color matching functions than many professional applications, so it should be quite accurate unless I made an error in the implementation.

    As for being Mr Color... well, I do work with dyes in real life, so that may be an accurate description.

  18. #18
    Join Date
    Apr 2008
    Location
    Amsterdam, NL
    Posts
    1,945

    Default

    The download link is broken

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

    Default

    Fixed. Stupid kernel updates sometimes disable httpd on my workstation.

  20. #20
    Join Date
    Jun 2009
    Posts
    113

    Default

    Quote Originally Posted by tocket View Post
    Yes, look at the installation instructions in the first post.

    The server is very fast though; I download the file in just 40 seconds.
    smokin' along at 51.2 KB/sec...

  21. #21
    Join Date
    Apr 2008
    Location
    Amsterdam, NL
    Posts
    1,945

    Default

    Very nice software! thanks for sharing.

    It motivated me to add 200mW 405 to my projector to get a nicer white.

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

    Default

    Thanks. Keep in mind 405 nm makes the beam look a bit weird as it's hard to focus on. At least for me. It does have a significant impact on the color though. Mixing deep red and violet gives some amazing colors.

    Quote Originally Posted by laserist View Post
    smokin' along at 51.2 KB/sec...
    Hehe, guessing you don't live in Europe. I get 5-6 MB/s, but I live only 2 km from the server.

  23. #23
    Join Date
    Jul 2009
    Location
    The Netherlands
    Posts
    1,213

    Default

    The speed is very ok! I really do love my 100/100Mbit fiber connection.
    Thanks Tocket for this excellent and interesting piece of software.

  24. #24
    Join Date
    Apr 2008
    Location
    Amsterdam, NL
    Posts
    1,945

    Default

    Quote Originally Posted by tocket View Post
    Thanks. Keep in mind 405 nm makes the beam look a bit weird as it's hard to focus on. At least for me.
    How thick is your 405 beam?, if its a normal 5mm beam it makes sense becouse it fatter than your other beams.

    I have replaced my original aixis lenses with 5mm beam for special lenses with 1mm beam diameter and 0,8mrad and this made a huge improvement for my red and color mixing

  25. #25
    Join Date
    Apr 2008
    Location
    Purmerend, NL
    Posts
    247

    Default

    Is the beam diameter not an factor that's relevant to the color table?

Posting Permissions

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