Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port rio-color operations #17

Open
kylebarron opened this issue May 25, 2020 · 3 comments
Open

Port rio-color operations #17

kylebarron opened this issue May 25, 2020 · 3 comments

Comments

@kylebarron
Copy link
Owner

Gamma adjustment adjusts RGB values according to a power law, effectively brightening or darkening the midtones. It can be very effective in satellite imagery for reducing atmospheric haze in the blue and green bands.

Sigmoidal contrast adjustment can alter the contrast and brightness of an image in a way that matches human's non-linear visual perception. It works well to increase contrast without blowing out the very dark shadows or already-bright parts of the image.

Saturation can be thought of as the "colorfulness" of a pixel. Highly saturated colors are intense and almost cartoon-like, low saturation is more muted, closer to black and white. You can adjust saturation independently of brightness and hue but the data must be transformed into a different color space.

Saturation looks like a more difficult operation, plus it already exists in luma.gl's shadertools.

But gamma and sigmoidal don't look that hard to port.

@kylebarron kylebarron changed the title Port rio-color Port rio-color operations May 25, 2020
@kylebarron
Copy link
Owner Author

Note that some operations that are efficient in C aren't efficient in GLSL because of if/else branching.

Here's an example of a fast rgb2hsv and hsv2rgb optimized for the GPU (used in saturation).

@kylebarron
Copy link
Owner Author

@kylebarron
Copy link
Owner Author

This was referenced Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant