Lightpack icon indicating copy to clipboard operation
Lightpack copied to clipboard

Do color blending after gamma correction and increase the resolution of color calculations to 16 bit

Open Womifa opened this issue 4 years ago • 3 comments

Color blending should be done after gamma correction so I used the "Device Gamma" value to gamma correct the screen color values before they are averaged the LEDs. As I have no idea how SSE4.1 and AVX2 work, the averaging function is pretty basic. The averaged color values are then reencoded with the device gamma to maintain compatibility. I also increased the resolution of all color calculations to 16 bit per channel to have more data to work with when performing dithering calculations. This might also be useful for LEDs that have more than 8 bit of resolution.

Womifa avatar Sep 19 '20 20:09 Womifa

Can one of the admins verify this patch?

psieg-jenkins avatar Sep 19 '20 20:09 psieg-jenkins

Can one of the admins verify this patch?

psieg-jenkins avatar Sep 19 '20 20:09 psieg-jenkins

I'd prefer to do the two things in separate steps. Increasing internal resolution to 16 bits for the computations sounds fine.

As for the Gamma, I'm not convinced. The value is the "device gamma" value because it's applied to the colors sent to/displayed by the device. It's not gamma correction for the captured image, though the main use case is using it for that. I understand that order matters in theory but I doubt it matters in practice. Do you see a noticeable difference in the results with this?

Also we just introduced the averaging using AVX to reduce Prismatik CPU load. AFAIK AVX wouldn't work with simultaneously applying gamma, because it's not the same operation on all values. One would have to apply gamma to all pixels and then accumulate using AVX, which is slower and uses more CPU.

psieg avatar Sep 27 '20 15:09 psieg