Bonzo wrote:something like a png which is not compressed.
PNG is compressed, just not lossy-compressed. It is an important distinction.
Better still if the intermediate image is only going to be read by another IM command you can use MIFF, with preserves more of the images meta-data than PNG but this is definably NOT compressed.
Better still use the special file format MPC
http://www.imagemagick.org/Usage/files/#mpc
whcih performs a straight memory dump of the image to disk.
This file can be directly 'paged' back into the memory the next "convert" run being performed by same script as the previous command. This means IM does not have to format, encode, or decode the intermediate image data, making the image read by the next program extremely quick.
However be sure to clean up both of the two files this image file format creates. You need to clean up intermediate files anyway so that is not a big problem.