I am really sorry but it's too difficult to use the right terminology on a foreign language.
Abstract: I want to create a program that takes two inputs, an image and a number p, p is in degrees (ex from 0 to 360) and outputs an image_out. I want the program to be associative (if this is the correct term) meaning that:
image_120 = program(image, 120)
image_360 = program(image_120, 240)
image = image_360
Each image is a set of pixel and each pixel has an RGB (red, green, blue) value meaning that the pixel's space is [0, 255]x[0, 255]x[0, 255] .
So, what I need is a function f = f(r, g, b) which maps back to [0, 255]x[0, 255]x[0, 255] in a unique way, meaning that there is an inverse of f. Also, if possible, I need f to be parametrized by a parameter p in [0, T] as I mentioned, such that:
f(r, g, b; p + T) = f(r, g, b; p), like a period.
I know this question is kind weird but I couldn't ask in in a different channel on stackoverflow due to its math dependency. To give more abstract context, I want to create a "I am not a robot" module in a website. The user will see an image and a slider. The user will be able to slide the slider in a certain range and the image will gradually change colors until the user sees it as normal. For example, an image with a sky (blue) and a land (green), will load at first with weird colors (ex, purple and orange) and as the user slides the slider the image will change color and at some point it will match the original image. I hope this context helps about the function properties.