I ran your macro on Mac with ROOT master (that should not make any difference because this code has not changed for a. long time) and it works. I do not get any error message and it produces the following file.
Is TASImage working correctly on your machine ? can you produce a simple jpeg or gif file ?
Thanks for checking! Saving single images with any type seems to be possible.
root [1] c1->SaveAs("test.jpg")
Info in <TCanvas::Print>: file test.jpg has been created
root [2] c1->SaveAs("test.png")
Info in <TCanvas::Print>: file test.png has been created
root [3] c1->SaveAs("test.gif")
Info in <TCanvas::Print>: GIF file test.gif has been created
root [4] c1->SaveAs("test.gif+1")
Error in <TASImage::WriteImage>: error writing file test.gif+1
Only the output to animated gif (with e.g. “+100”) fails.
root [0] TH1F h; h.Draw()
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
root [1] c1->Print("test.gif+")
Error in <TASImage::WriteImage>: error writing file test.gif+
Just to report: I also have a ROOT 6.34.00 version installed here, and using this version does not produce the error. Could something be wrong with the 6.36 installation?
------------------------------------------------------------------
| Welcome to ROOT 6.36.05 https://root.cern |
| (c) 1995-2025, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for macosx64 on Nov 13 2025, 14:27:39 |
| From heads/v6-36-00-patches@v6-36-02-29-g40f86fe94f2 |
| With Apple clang version 17.0.0 (clang-1700.4.4.1) |
| Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------------
root [0] .x test.C
Info in <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
root [1]