Calculating Image Sizes
To calculate the size of an image:
File Size (bits) = Width x Height x Channels x Bits per channel
Example 1
For example for a normal 2000 by 3000 color RGB image:
- Width: 2000
- Height: 3000
- Channels: Red, Green, Blue
- Bits per channel: 8 ( 0 to 255)
2000 x 3000 x 3 x 8 = 144,000,000 bits
Convert to Bytes:
144,000,000 / 8 = 18 Megabytes
Example 2
For example for a 2000 by 3000 color Grayscale image:
- Width: 2000
- Height: 3000
- Channels: Grey
- Bits per channel: 8 ( 0 to 255)
2000 x 3000 x 1 x 8 = 48,000,000 bits
Convert to Bytes:
48,000,000 / 8 = 6 Megabytes
Example 3
For example for a custom 40 by 30 Black and White Image
- Width: 40
- Height: 30
- Channels: 1 (Black)
- Bits per channel: 1
40 x 30 x 1 x 1 = 120 Bits
Convert to Bytes:
120 / 8 = 15 Bytes
Example 4
For example for a custom 50 x 20 8 bit image
- Width: 40
- Height: 30
- Channels: 1
- Bits per channel: 8 bits per pixel.
50 x 20 x 8 = 8000 bits
8000 / 8 = 1000 bytes
1 Kilobyte
Activity Complete