Q:

pixels to data - relationship

What exactly is the correlation between the amount of pixels in an image and the correlating space it will take up on one's hard drive?  I know that the more pixels / more storage but is there an exact linear correlation between these two metrics or is it more complicated than that?

A:

Images store a two dimensional array. Uncompressed data thus uses up roughly:
x dimension * y dimension * size of one channel (usually 1-4 bytes)* number of channels per layer (usually 3-5) * number of layers
Note this is a big number for big images. Much of this data is redundant because many layers contain areas of same color etc. Compression acts on this redundancy. Its impossible to say how much the image gets compressed, generally the image compresses better the larger it is. Some images compress really well others not so much. It is common to see that some larger images are smaller on disk than smaller ones. Especially 2bit 2 color images compress amazingly well for their pixel size.
Then there is the disk itself the disk usually allocates a allocation block so no matter what your image size this is the minimum space it takes. In effect the image size is quantized by allocation blocks. Big disks can have huge allocation blocks.
So while pixel images technically grow exponentially its impossible to tell because of compression. Its a bit like putting random stuff into a opaque balloon blow it up, and ask people what size it will take after its deflated. Imopossible to know unless you know what the balloon contains.
Best not draw any conclusions between size on disk and size in pixels. But certainly knowing the upper limit might help.

