Generate mult-image TIFF (stack of TIFFs)


I would like to generate a mult-image TIFF file,
like in the example below.
Currently this is not supported in ROOT 5.19.02.

Is there an alternative method to generate multi-image
TIFFs from within ROOT ?


// example of a macro that might work in the future
TImage *img = 0;
gSystem->Unlink(“imgstack.tif”); // delete existing file

for (int i = 1; i <= 3; i++) {
   delete img; // delete previous image

   // Read image data. Image can be in any format, e.g. png, gif, etc.
   img = TImage::Open(Form("image%d.jpg", i));

   if (i < 10) {
       // add image to the multi-image tif


it is not possible.
As alternative you can save multiple images in a ROOT file.
See gallery.root as an example. Images are saved by using ROOT I/O
and internally are PNG compressed.

Regards. Valeriy