I am working with a collection of RGB value integers ranging from 0 to 255, organized into eight separate lists. For example, one list contains 8,349,042 values, equivalent to 2,783,014 RGB sets of three.
The main goal is for the user to select a pixel in an image, grab its (R,G,B) value, and search for it within these lists. Since all the lists together encompass all possible RGB combinations (16,777,216), the pixel's value will be found in one of them.
I am currently exploring the best method for storing and efficiently searching through these static values, which do not change and are predetermined within a known range.
My current approach involves generating these lists using Javascript by assigning each value based on its proximity to a base color. The results are then saved as text and stored in a large array.
In order to optimize the search process, I am considering alternative data structures such as trees or hashes, as well as bit/byte-based approaches due to the numeric nature of my data.
While experimenting with different storage options, including JSON files and arrays, I encountered challenges with asynchronous loading and accessibility of the data when needed. This prompted me to seek advice on more efficient strategies.
Furthermore, I am open to exploring backend technologies like Node.js for potential performance enhancements, although I may need guidance on transitioning from frontend to backend development.
Ultimately, my simplified question revolves around finding the best technique in JavaScript to search for a specific (x,y,z) value within a massive array of 2 million entries, potentially requiring a different data format for optimized searches.