Answer the question
In order to leave comments, you need to log in
Memory calculation when running php gd?
Approximately how much memory will an image in a variable size, say, 5000x5000 pixels, take up when working through php gd ?
If anyone has come across something that can lead to an approximate formula.
Answer the question
In order to leave comments, you need to log in
Ideally, this would be
5000 * 5000 * 32 = 800 million bits высота * ширина * количество_бит_на_пиксель
for a 32-bit color , which is just under 800 MB.
In practice, processing will require about 2.5 times more (an empirical coefficient, which may well depend on the environment and build parameters).
From my experience I can say that you will run out of memory. I don't know what GD does there, but for large images it consumes a crazy amount of memory. Images over 2k per side are already becoming a problem. Use Image Magic.
PS. www.dotsamazing.com/ru/labs/phpmemorylimit
Measure yourself with php.net/manual/ru/function.memory-get-usage.php for a dozen different smaller images. And extrapolate.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question