Saving canvas as gif file

when I write in my macro:
void mymacro(){

TCanvas *c1 = new TCanvas(“c1”,“MyCanvas”,0,0,500,500);
histogram->Draw(); // 1D histogram filled with some data

and run this with
root -q -b mymacro.C
the resulting gif file has size more than 100 kB

when I draw the histogram interactively and (using the mouse) save it as gif, I’m left with a gif file of just 5 kB!!!

Looking at resulting gif files, I can’t see any difference in quality.

How to force ROOT to make a reasonably small gif file using TCanvas::SaveAs?

I’m using version 5 of root…
the big file is,
the small one

Thanks for help

we have different GIF image generation algorithms for
interactive and batch mode.
Hopefully we will remove this difference in the nearest future.
I would recommend to use PNG instead of GIF image format.

Regards. Valeriy

saving to PNG file works fine:-)
In fact I don’t need gif files any more…

and PNG file size is about 5-10 kB, which is good