You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This may be a bit too specific but I find it quite common. The idea is to have a function map_linear_colors(), similar to map_colors(), that operates on Images with Rgb/a pixels. For each pixel:
Remove gamma correction: Rgb<u8> [0,255] -> linear Rgb<f32> [0,1].
Apply user function: f(linear RGB) -> linear RGB.
Apply gamma correction: linear Rgb<f32> [0,1] -> Rgb<u8> [0,255].
(I think I got the naming right)
If is interesting for the library, I could do a PR for it.
The text was updated successfully, but these errors were encountered:
I think this libraries policy is to always assume linear color space due to implementation complexity/performance and we are otherwise color-space agnostic.
That said you could accomplish this pretty easily in user-land using:
This may be a bit too specific but I find it quite common. The idea is to have a function
map_linear_colors()
, similar tomap_colors()
, that operates on Images with Rgb/a pixels. For each pixel:Rgb<u8> [0,255] -> linear Rgb<f32> [0,1]
.f(linear RGB) -> linear RGB
.linear Rgb<f32> [0,1] -> Rgb<u8> [0,255]
.(I think I got the naming right)
If is interesting for the library, I could do a PR for it.
The text was updated successfully, but these errors were encountered: