According to the answer above, a Q16 version of ImageMagick needs 8 bytes of memory space per pixel. Now I use Q16 version of ImageMagick, and I have an image (XXX.jpg), which size is 5680 x 3787 (px). Below is my PHP code of ImageMagick:
$file = "XXX.jpg";
$image = new Imagick();
$image->readImage($file);
$type = $image->getImageFormat();
$image->setFormat($type);
echo $image->getImagesBlob();
Theoretically, it should take 5680 * 3787 * 8 = 172081280 bytes = about 164.11 MB of memory usage. But I look up the memory usage statistics, the virtual memory usage takes up to 315.03 MB and the physical memory usage takes up to 349.71 MB. The usage amount is extremely higher than what I expected. What happened to the memory usage? Is there any miscalculation?
By the way, how to calculate the CPU usage of ImageMagick?
P.S. Below is the PHP information of my ImageMagick: