
Given a square of dimensions x by y pixels, how many permutations of colors of pixels are there in the square? Assume that each square is 1 pixel and that this square is 5x5 pixels. How many unique ways can this square of pixels be permuted? Also assume that the specific colors shown here don't matter.
Assume we have $k$ distinct colors and the number of each color is $n_1,\ldots,n_k$. Then the answer is $$\frac{(xy)!}{n_1!n_2!\cdots n_k!}$$ by the elementary combinatorial formula for enumerating permutations.