Calculating the Normal of a pixel

Can someone provide some insight into this problem? If I have a R,G,B value - How do I calculate the normal? Do I take the normalized value of the surrounding pixel values?


Do you know what is a surface normal ? It is a vector that perpendicular to the local surface, and points outside.

This has nothing to do with color, but with geometry.
You can “fake” it by using the color texture as displacement map, so interpret luminosity difference as depth difference, and infer local plane to build normal vector. Something like a low pass filter can give results.