# Number of $2 \times 2$ images in RGB

I am a bit rusty on math and was wondering if someone could check my back of the envelope calculation.

Each RGB component has values between 0 and 255 inclusive. There are three components so you have $256^3$ possible colors in this format.

That means that for a 2 pixel by 2 pixel image there would be $(256^3)^4$ possible combinations, correct?

Thank you.

• There are $256$ integers between $0$ and $255$ inclusive. Jan 30, 2016 at 0:56
• Yes that's correct. There are $256$ ways to choose each R,G and B component, so $256^3$ possibilities per pixel. Thus if there are $N$ pixels, there are $(256^3)^N = 256^{3N}$ possible images of that size. Jan 30, 2016 at 1:01
• This is correct provided you don't take any weird symmetry considerations into account. Jan 30, 2016 at 1:35