MindBuffer / smode_laser_plugin

Smode plugin for sending streams to LASER projectors
2 stars 2 forks source link

Convert non-linear sRGB to linear sRGB (or vice versa) #21

Open mitchmindtree opened 4 years ago

mitchmindtree commented 4 years ago

Currently the visual representation in the DAC emulator appears to be a little dull compared to the pre-visualiser in SMODE. We should check if there needs to be some gamma correction here and apply it before submitting frames to the stream.

francis-maes commented 4 years ago

Note: the colors sent by smode currently depend on the gamma setting of the compo in which they lie. It can be either sRGB gamma 2.2 or linear gamma 1.0. I noted in #26 that I need to standardize this in order to provide you always color that are expressed with the same gamma value. Which gamma do you need?

mitchmindtree commented 4 years ago

Thinking on this some more, it is not always clear what gamma will be preferred as each DAC may be plugged into any LASER projector, each of which may have a slightly different color profile. I just had a skim through the ILDA specification and it looks like only the voltage for each color channel is standardised and a wavelength for each channel is recommended, however nothing is mentioned of color spaces or their transfer functions.

Perhaps we can standardize on linear gamma by default, and then if you like you can provide a parameter for gamma correction as a kind of post-processing step?

I believe our emulator visualiser example might incorrectly assume that the color data is non-linear sRGB, when it should probably assume the color data is linear instead.