How to Calculate Image Size from Pixels and Colour Depth
Learn how to calculate uncompressed image size from pixel dimensions and colour depth, convert bits to bytes, and avoid a common GCSE Computer Science mistake.
To calculate uncompressed image data size, multiply the image width by its height to find the number of pixels, then multiply by the colour depth:
size in bits=width in pixels×height in pixels×colour depth in bits per pixel \text{size in bits} = \text{width in pixels} \times \text{height in pixels} \times \text{colour depth in bits per pixel} size in bits=width in pixels×height in pixels×colour depth in bits per pixelDivide the result by 888 to convert bits to bytes. Keep track of the units at each step: the multiplication gives bits because colour depth is measured in bits per pixel.
What the terms mean
A pixel is one point in a digital image. The width and height tell you how many pixels are arranged across and down the image. Multiplying those dimensions gives the total number of pixels. Colour depth is the number of bits used to store the colour of each pixel. At a colour depth of 242424 bits per pixel, every pixel contributes 242424 bits to the uncompressed image data. The dimensions alone are not enough to calculate the size: you also need the colour depth.
Worked example
Suppose an image is 800800800 pixels wide and 600600600 pixels high, with a colour depth of 242424 bits per pixel. First find how many pixels it contains:
800×600=480,000 pixels 800 \times 600 = 480{,}000\text{ pixels} 800×600=480,000 pixelsNow multiply by the bits needed for each pixel, then convert to bytes:
480,000×24=11,520,000 bits 480{,}000 \times 24 = 11{,}520{,}000\text{ bits} 480,000×24=11,520,000 bits 11,520,000÷8=1,440,000 bytes 11{,}520{,}000 \div 8 = 1{,}440{,}000\text{ bytes} 11,520,000÷8=1,440,000 bytesIf the question defines a kilobyte as 1,0001{,}0001,000 bytes, the answer is 1,4401{,}4401,440 kilobytes. Use the conversion specified in the question. If none is given, state whether you use 1,0001{,}0001,000 or 1,0241{,}0241,024 bytes per kilobyte so your working is clear.
Common exam mistake: giving the result after multiplying by colour depth as bytes. It is still in bits until you divide by 888. This method calculates uncompressed pixel data, not necessarily the size of an image file: a file can contain extra information or use compression. Check what the question asks for before giving your final unit.