Converting a pad to a png file

Hello, again.

I’ve tried to convert a histogram on a pad to a png file, like it is in the tutorial.
But when i do it, i must let the pad pop up in the window.
I’ve tried putting the option “GOFF” but then the png goes with the image in my screen not the histogram.
Is there a way of doing it without the pad popping up so i can work in a remote location?

Thanks a lot.

As far as I know an X11 window is needed to generate a pgn file. This facility uses TASimage

The ROOT 4.00.08 can be built with the optional Qt layer
( see: )
As soon as you build and turn it on you can create the various Pixmap formats.

Png format is the default one provided by Qt layer

TASImage is now supported on all platfroms.
Currently supported formats are GIF, JPEG, PNG, TIFF, XCF, XPM, PPM/PNM, BMP and ICO.

Regards. Valeriy

I don’t quite understand.
Now is there an easy way to create PNG’s from canvasses without X11? Or does this mean I have to recompile ROOT?

not yet, without Xserver,
but work is under way.
Must be ready by next release.

Regards. Valeriy

OK, thanks for the quick reply.

I found out, that the creation of EPS files works without a running x-server via:

MyPad->Print("canvas.eps") ;

but the creation of GIF in the same way causes an error “cannot create gif file in batch mode”.

So a workaround would be to create the EPS file and convert it with ImageMagick’s “convert” to PNG/JPG/whatever.

yes, you are on the right way :smiley:
as it’s done in carrot.
You can also can use gs to convert
eps to gif.

Regards. Valeriy

Is there any way to run the “convert” command directly from my application using the Root libs?

Something like this:

gSystem->Exec("convert pic.eps pic.png");

But the above gives me an error “`gSystem’ undeclared”
(I am not running on the CINT!)

Any hint?

#include “TSystem.h”

where gSystem is defined.
You can find a code prototype at … Apache:Put

look for ConvertToJpg, ConvertToGif

Regards. Valeriy

This is very cool… Thanks a lot!