I am using simple commands like this in Imagemagick to modify an image:

PHP Code:
<?php
exec
("convert input.jpg output.png");
?>

When things get more complicated and you want to use the image more than once I can use:

PHP Code:
<?php
exec
("convert input.jpg -write mpr:image +delete \( mpr:image -thumbnail x480 -write 480_wide.jpg \) \( mpr:image -thumbnail x250 -write 250_wide.jpg \) \( mpr:image -thumbnail x100 -write 100_wide.jpg \) \( mpr:image -thumbnail 64x64! -write 64_square.jpg \) \( mpr:image -colorspace Gray -write black_white.jpg \)");
?>
This holds the image in the memory and it can be used multiple times BUT only within the exec( ) it was created in as when I leave the exec( ) I can not call it in the next exec( )

I would like to modfy an image in one exec( ) then hold it in the memory and call it with a different exec( ) later.

Another way would be to save the image into a variable ?

Another idea: How would I go about using the temp folder as the items are automaticaly deleted from there ? Would this be the way to go althogh it will not be as fast as the images are not already in the memory.