Memory use with GD image manipulation

Discussion in 'PHP' started by Cobnut, Jul 23, 2008.

  1. #1
    I've been playing with some image trickery using GD and am coming across some issues with memory requirements when using imagecreatetruecolor.

    This seems to need an enormous amout of memory to work and I'm having to set silly memory_limits to load (and work with) even relatively small files (~ 1Mb).

    Does anyone have any advice for a more efficient way to manipulate largish true colour images? Say, a 2000 x 1000 pixel jpeg loaded from a form?

    Is there a simple and easy to remember formula for working out the memory required for a given size image with a given color depth? (Well, yes there is, I just can't find it :) ).

    Jon
     
    Cobnut, Jul 23, 2008 IP