Assuming that "Adjusting the color values of each Pixel" takes constant time, your reasoning is correct, since there are N*M
pixels, the complexity is O(N*M)
.
For your information, to make your answer more complete, you should also mention the assumption, that is that you assume "Adjusting the color values of each Pixel" takes constant time. If that process (which is repeated N*M
times) takes, say O(M)
, then the algorithm is O(N*M*M)
, since for each pixel you need to do an O(M)
operation.