title: How to calculate the memory needed for processing an image?
body: <p>I want to put some restrictions to the images uploaded by the users, so the script that process them never runs out of memory.</p>
  
  <p>The images that take more memory, are the ones with higher resolution. They don't need to have a big size in bytes. For example, a 46kb image, with 4000x2500 resolution, and some transparencies (PNG), took around 90mb to resize it.</p>
  
  <p>Is there a way to precalculate the memory needed accurately?</p>
  
  <p>Any ideas?</p>