Look at GetPixelsSize for details.
function ImGetPixelsSize(Format: TImageFormat; Width: LongInt; Height: LongInt): LongInt; cdecl;
ImagingExport (at line 191)