I need to generate a color map which I am not sure exist. I have a 1024x1024 image which would contain 2^20 pixels. I have 3 color channels which each have 8 bits which would leave us with 2^24 possible colors. This problem is easy to solve with non continuous functions where you simply use 4 bits of the final channel on both of the first two channels to create two 12 bit channels.
Unfortunately, I have a new constraint where all three channels of the map must remain continuos (I mean that each individual neighboring pixels channel value does not change by more than one) as neighboring values may be interpolated together. As this is being used as a lookup table, the interpolation of non continuous values would result in inaccuracies.
To put it in a slightly different way, I need a function f and f^-1
f(x, y) = r, g, b
f^-1(r, g, b) = x, y (only existing in the original x,y range)
with r, g, b, being 8 bit numbers (the integers 0 - 255) and x and y being 10 bit numbers (the integers 0 - 1023). All neighboring r,g,b values must be continuous. By continuous, I mean that each individual neighboring pixels channel value does not change by more than one. Do such functions exist, and if so, what are they?