All possible combinations of pixels in an image. Forgive me if this is a rudimentary question but It's been about 4 years since I took stats, so it's pretty much all gone. 

Say I have an image which is nxm pixels, and each pixel has 3 layers (RGB) that have 256 levels each, how do I calculate all possible combinations of images representable in this format? 

Is it simply (I doubt it):

$$ 256^3 \cdot n \cdot m $$

Or something like:

$$ \frac{(nm)!}{256!256!256!}$$

Thanks in advance.
Each layer has $256$ possible values. There are $3$ layers per pixel, and there are $nm$ pixels. This gives you

$$256^{3mn}.$$
$256^{3+m+n}$ since there are $256^3$ possible colors in each pixel