DIGITAL QUANTITY WORKSHEETS

Comparing pixel-dimension scaling with frame-count scaling

Doubling both the width and height of a raw image quadruples its storage, while doubling the number of frames only doubles it. This worksheet separates the two scaling rules using a 100 by 50 frame at 24 bits.

Two different ways to make a file larger

Raw image storage grows when you add pixels to each frame and when you add frames. These two changes feel similar but scale differently. Making a picture twice as wide and twice as tall multiplies the pixel count by four. Keeping the dimensions and doubling the number of frames multiplies the total by two. The uncompressed image size calculator uses the formula bytes equals the ceiling of width times height times depth divided by 8, times frames. This worksheet applies it to a small frame so every number can be checked by hand, then extends the same logic to familiar resolutions. Compression, codecs and metadata are outside the model, which counts only the raw sample data.

The original frame

A frame of 100 by 50 pixels contains 5,000 pixels. At a depth of 24 bits per pixel, the frame needs 5,000 times 24, which is 120,000 bits. Dividing by 8 converts to 15,000 bytes. The calculator reports the byte count and, separately, the same quantity in decimal megabytes, which is bytes divided by 1,000,000, so this frame is 0.015 megabytes. A depth of 24 bits corresponds to three 8-bit channels, the common arrangement for red, green and blue. This arrangement gives 256 levels per channel and 16,777,216 possible colors. All of the arithmetic here is exact, and the ceiling operation has no effect because the bit count divides evenly by 8. The 15,000 byte figure also equals 3 bytes for each of the 5,000 pixels, which is a quick mental check on any 24-bit estimate.

Doubling both dimensions

Doubling the width to 200 and the height to 100 gives 20,000 pixels, four times the original 5,000. The storage is 20,000 times 24 divided by 8, which is 60,000 bytes. The factor of four comes from multiplying two doubling factors, 2 for width and 2 for height. The area of a rectangle scales with the square of a uniform length scale. Tripling both dimensions would multiply storage by nine, and halving them would cut it to a quarter. This square law is why moving from a modest resolution to a much finer one can inflate raw size faster than intuition suggests. The aspect ratio stays the same, since 100 to 50 and 200 to 100 are both 2 to 1, which shows that scaling the pixel grid uniformly changes storage by the square of the factor.

Doubling the number of frames

Two frames of the original size use twice the bytes of one: 2 times 15,000, which is 30,000. The relationship is linear. Ten frames take ten times as much, and a thousand frames take a thousand times as much. Frame count multiplies the whole per-frame size, so it does not interact with the dimensions or the depth. The comparison with the previous section shows why the two operations should be tracked as separate fields: the 200 by 100 single frame needs 60,000 bytes, and two frames at 100 by 50 need 30,000, even though each change seems to double something. The same rule covers layers, color planes stored as separate images and sensor bursts, as long as every item has identical dimensions and depth.

A common display resolution

A full HD frame is 1,920 by 1,080 pixels, which is 2,073,600 pixels. At 24 bits per pixel that is 6,220,800 bytes, or 6.2208 decimal megabytes per frame. A 4K UHD frame of 3,840 by 2,160 doubles both dimensions, so it has 8,294,400 pixels and needs 24,883,200 bytes, four times the full HD figure. The check confirms the square law. Ten full HD frames take 62,208,000 bytes. The numbers describe raw sample storage only. A file in an actual image format adds headers, may pad each row to a boundary and normally compresses the pixel data. Dividing by the 5,000 pixels of the small frame shows the scale: a full HD frame has 414.72 times as many pixels, and the byte count grows by the same factor.

Frame count in video

Raw video makes the linear factor visible. At 24 frames per second, ten seconds of full HD video at 24 bits per pixel has 240 frames, and 240 times 6,220,800 bytes is 1,492,992,000 bytes, or about 1.49 gigabytes. Doubling the frame rate to 48 frames per second doubles that to about 2.99 gigabytes. Doubling the resolution to 4K quadruples it to about 5.97 gigabytes. Doubling the frame rate and doubling only the width gives the same raw size as 4K at the original rate, so keep width, height and frame count as separate factors and multiply them. Real video is stored in compressed form at far smaller sizes. Frame count and duration are linked by frame rate. Frames equal frames per second times seconds, so a clip of 10 seconds at 24 frames per second has 240 frames.

Changing the bit depth

Depth is the third scaling factor, and it is linear like frame count. An 8-bit grayscale frame at 1,920 by 1,080 needs 2,073,600 bytes, one third of the 24-bit color figure. A 32-bit frame, such as red, green, blue and alpha at 8 bits each, needs 8,294,400 bytes. A depth of 1 bit, as used in a simple black and white mask, packs eight pixels into each byte. This is where the ceiling matters: a 3 by 3 mask at 1 bit per pixel has 9 bits, and 9 divided by 8 rounds up to 2 bytes. The final byte may be partly empty, and the formula charges for it. Depth values that are not multiples of 8, such as 12 bits per pixel, are legal in the formula, and the ceiling still rounds the per-frame total up to a whole byte.

Decimal megabytes and binary mebibytes

The calculator reports megabytes as bytes divided by 1,000,000, following the decimal SI prefix. Operating systems and some software report sizes in mebibytes, which divide by 1,048,576. For the full HD frame, 6,220,800 bytes is 6.2208 MB in decimal terms and about 5.93 MiB in binary terms. Neither figure is wrong, but they are different numbers, and comparing a decimal figure from this tool with a binary figure from a file manager can look like a discrepancy of about 5 percent. IEC 80000-13 names the binary units, so labeling a figure as MB or MiB removes the doubt.

What the model leaves out

The size calculated here is the number of bytes needed for raw samples at the stated depth. Real files add header information, color profile data and sometimes thumbnails. Some formats pad each row to a multiple of four bytes, so a width that does not fit the padding rule needs a little more space. Chroma subsampling, used in many video formats, stores color at lower resolution than brightness, which cuts the raw size below the full 24 bits. Compression changes the size even more, and the saving depends on the content. Use this worksheet to estimate working buffers and uncompressed capture sizes, and look at the specification of the target format for anything else. The model also ignores any gaps between frames in a container and any audio or timing data stored with them.

Estimating a capture buffer

The same formula sizes memory buffers. A camera sensor image of 4,000 by 3,000 pixels has 12,000,000 pixels, and at 24 bits it needs 36,000,000 bytes, or 36 decimal megabytes, for one uncompressed frame. A burst of three such frames needs 108,000,000 bytes. A program that holds the full burst in memory must reserve at least that much, plus the space for any copies it makes. The figure also explains why saving a high-resolution image as an uncompressed file produces something very large compared with its compressed counterpart. The estimate is a floor and not a ceiling, because real systems add alignment and processing buffers. Sensors often record more than 8 bits per channel, and the depth field in the calculator can be set to match.

Scaling by factors other than two

The square law holds for any uniform scale factor, not only for doubling. Scaling the 100 by 50 frame by 1.5 in each direction gives 150 by 75, which is 11,250 pixels and 33,750 bytes at 24 bits. That is 2.25 times the original 15,000 bytes, and 2.25 is 1.5 squared. Scaling by one half gives 50 by 25, which is 1,250 pixels and 3,750 bytes, a quarter of the original. If only one dimension changes, as when stretching the width alone, the storage changes in proportion to that one factor. Resizing tools often round the new dimensions to whole pixels, so enter the final pixel counts and not the nominal scale factor. The same scaling applies to height alone: stretching the 50 pixel height to 75 while keeping the width of 100 gives 7,500 pixels and 22,500 bytes, exactly 1.5 times the original.

Planning storage for a sequence

When the width, height and depth stay fixed, the storage for a sequence of frames is the single-frame size multiplied by the frame count. That makes it easy to work backward from a capacity. A budget of 1,000,000,000 bytes holds 66,666 frames of the 100 by 50 example, since 15,000 divides into the budget about 66,666.7 times and only whole frames count. The same budget holds 160 frames of full HD at 24 bits, because 6,220,800 divides into it about 160.75 times. Rounding down is the safe direction, because a partial frame has no use. Remember to leave room for any headers, index tables or companion files that the real storage system adds, which this calculation does not include. A related check is the opposite direction: dividing a measured file size by the per-frame size reveals how many frames a raw file should hold, and a remainder points to a header or a different depth.

Reproduce the checks

Original frame

Open the Uncompressed Image Size Calculator and enter:

Width
100
Height
50
Bits per pixel
24
Frames
1

Expected output:

Uncompressed size

15000

The original contains five thousand pixels.

Both dimensions doubled

Open the Uncompressed Image Size Calculator and enter:

Width
200
Height
100
Bits per pixel
24
Frames
1

Expected output:

Uncompressed size

60000

The pixel count grows by a factor of four.

Two original frames

Open the Uncompressed Image Size Calculator and enter:

Width
100
Height
50
Bits per pixel
24
Frames
2

Expected output:

Uncompressed size

30000

Frame count supplies a separate linear factor.

References and implementation scope

The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.

Sources

Related tasks