How to draw histograms in PNGs or JPEGs quietly?

I need to draw hundreds of histograms and save each in a PNG or JPEG file. How to do this in batch mode? I.e., I don’t want to see each picture while processing.

mycanvas.SaveAs(“canvas.jpg”);

Rene