The great majority of .jpg are RGB (grayscale is possible but very rare.)
size() of an RGB image when permitting only two output variables would store the number of rows in n, and three times the number of columns in m . When you use size() with fewer outputs than dimensions of the array, the result is not to throw away the extra dimensions. The product of the values returned by size() is always equal to the number of elements in the entire array.
B is constructed as a grayscale image, not as an RGB image.
Best Answer