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

Colorspace clarification #33

Open
sguimmara opened this issue Jun 26, 2023 · 1 comment
Open

Colorspace clarification #33

sguimmara opened this issue Jun 26, 2023 · 1 comment

Comments

@sguimmara
Copy link

sguimmara commented Jun 26, 2023

Hello, I've been using the colormap library in the three.js 3D renderer.

Starting with version 152, three.js applies an automatic gamma encoding on colors.

With this automatic encoding, the same scene using the viridis color ramp renders differently:

Before:
image

After:
image

My understanding is that now three.js applies gamma encoding (i.e converts from sRGB to linear) on the colormap colors because it expects them to be in the sRGB color space. Obviously this is not the case.

Does it mean that colors generated by colormap are already in linear space ?

@dy
Copy link
Collaborator

dy commented Jun 26, 2023

I won't be able to help you here unfortunately. But the library is very straightforward, it simply lerps color values between min and max colors. The way that sequence of colors is treated after (like gamma-correction, remapping or whatsoever) is out of scope of this library. So feel free to check the code and possibly post the solution here if you wish 🙏🏼

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

2 participants