It is not really a 3D image. The third dimension has the RGB values. That is why you can able to see the color image.
Let's see this example.
A is a 3D matrix, but RGB values are stored along the third dimension.
If you plot using only the X and Y coordinate, you would get like this in each of the third dimension.
The combination of these three images results into a color image.