Mapping function values to colors

  • Thread starter Thread starter spx2
  • Start date Start date
  • Tags Tags
    Function Mapping
Click For Summary
SUMMARY

The discussion focuses on the challenge of mapping function values, specifically Euclidean distance, to colors for visual representation on a grid of 400x600 or 800x600 cells. The user seeks to create a score function that visually indicates the proximity of two objects by transitioning colors smoothly from low to high values. Suggestions include utilizing HSV color generation to achieve a more intuitive color mapping. The need for effective color transitions to enhance visual clarity and relevance is emphasized.

PREREQUISITES
  • Understanding of Euclidean distance calculations
  • Familiarity with grid data structures
  • Knowledge of color theory, specifically HSV color models
  • Experience with data visualization techniques
NEXT STEPS
  • Research HSV color generation techniques for data visualization
  • Explore algorithms for smooth color transitions based on numerical values
  • Investigate existing libraries for visualizing grid data in Python or JavaScript
  • Learn about normalization techniques for mapping numerical values to color scales
USEFUL FOR

Data scientists, software developers, and anyone involved in visualizing numerical data on grids will benefit from this discussion, particularly those interested in enhancing the clarity and effectiveness of data representation through color mapping.

spx2
Messages
2
Reaction score
0
Hi,

I'm trying to write a score function.
The score function is applied to each cell of a grid
and because the grid has many cells ( 400x600 or 800x600 )
If I want to experiment with different score functions to
see which one is best I'd have to see some kind of visual results.
I thought of plotting that score function to the screen
(because viewing just numbers isn't enough any more)
and all it's values will be colors of pixels on a grid.
The problem is choosing the colors and the transition between low-values to
big values of the score function so that they show up as beeing relevant
and smooth to the eye.
Let's take euclidean distance as the score function for example.
If we have 2 objects,one fixed at the bottom right of the screen and one
starting in the upper left and moving towards upper right,then a transition of colors should
be made for the area where the fixed object is , and the signification of this will be
that the distance between these objects is getting smaller and smaller.
I have tried getting the euclidean distance normalized to fit in the color spectrum and then
plotting but that turns out to not be so good either.
I'm having difficulties finding the best mapping between colors->distance.

Has anyone tried this ?

Thank you
 
Technology news on Phys.org
SPX,

I don't know if this is actually helpful but have you looked into generating HSV colors? HSV is a numerical representation of color that is a lot closer to what we might think of as how a color is defined intuitively.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 0 ·
Replies
0
Views
2K
Replies
6
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K