To calculate the size of an image, the formula to use is: File Size (bits) = Width x Height x Channels x Bits per channel. For example, for a normal 2000 by 3000 color RGB image, the width is , the height is , the channels are Red, Green, and Blue and the bits per channel is . The calculation would be 2000 x 3000 x 3 x 8, resulting in a total of bits. When converted to bytes, this equals Megabytes.
In another case, for a 2000 by 3000 color Grayscale image, the width remains , the height is , but the channels consist of only Grey, and bits per channel is still . The computation is 2000 x 3000 x 1 x 8, which results in bits. When converting this to bytes, the size totals Megabytes.
Consider also a custom 40 by 30 Black and White image; here, the width is , the height is , and the channels account for 1 (Black), while the bits per channel is . Thus, the calculation goes as 40 x 30 x 1 x 1, yielding a total of bits. In bytes, this equals Bytes.
Finally, for a custom 50 x 20 8 bit image, the width is , the height is , the channels amount to , and each channel is composed of 8 bits per pixel. The computed size is 50 x 20 x 8, which results in bits, converting down to bytes, or Kilobyte.