-
Notifications
You must be signed in to change notification settings - Fork 447
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
Hey It NOT ISSUES But i need colormap Add cubehelix #2191
Comments
It is pretty difficult to retrieve values from a picture. In SDRangel color maps are stored as 256 (R,G,B) floating point values (0.0 to 1.0) from lower (left on the picture) to higher (right on the picture). If you can provide these values it will be no big deal to add this color map. |
This can be done in Python...
Then this snippet should print out the colormap structure to be inserted in from PIL import Image
im = Image.open('cubehelix.png')
pix = im.load()
xsize = im.size[0]
print("const float ColorMap::m_cubehelix[m_size] =")
print("{")
for xi in range(256):
x = int((xsize/256)*xi)
colortuple = pix[x, 0][:-1]
rf = colortuple[0] / 256
gf = colortuple[1] / 256
bf = colortuple[2] / 256
print(f" {rf:.4f}, {gf:.4f}, {bf:.4f},")
print("};") |
The explanation that goes with this palette seems to be here: https://people.phy.cam.ac.uk/dag9/CUBEHELIX/ Could be nice indeed. Alternatively it has a link to a Javascript page that can also print out the RGB values: https://people.phy.cam.ac.uk/dag9/CUBEHELIX/cubetry.html |
Two new colormaps:
|
The text was updated successfully, but these errors were encountered: