“Paper” output Root Graphics Workshop 16/07/2010.

7
“Paper” output Root Graphics Workshop 16/07/2010

Transcript of “Paper” output Root Graphics Workshop 16/07/2010.

Page 1: “Paper” output Root Graphics Workshop 16/07/2010.

“Paper” output

Root Graphics Workshop 16/07/2010

Page 2: “Paper” output Root Graphics Workshop 16/07/2010.

Introduction

This is a key part:

• The final “product” of data analysis (publications). • It must be of a very high quality.• It must be very reliable. • It must work in batch mode.

Two kinds of output:

•Vector graphics: PS, PDF, SVG. • PS and PDF are high quality output for publication. Easily scalable to

be include in LaTex documents (publications). • SVG allows to display vector graphics in web pages.

•Bitmap: GIF, PNG, JPEG etc... ROOT graphics relies on the libAfterimage library. A generic interface (TImage) is available. In principle it allows to interface any library like libAfterimage, but right now LibAfterimage is the only one used in ROOT.

 

TVirtualPSTVirtualPS

TImageDumpTImageDumpTSVGTSVG TPDFTPDFTPostScriptTPostScript

TImage: Imaging packageTImage: Imaging package

TAsimageTAsimage

LibAfterimage (gif jpeg, png, etc ….)LibAfterimage (gif jpeg, png, etc ….)

TPad Basic primitives

Page 3: “Paper” output Root Graphics Workshop 16/07/2010.

PS, EPS Status

Basically the TPostScript class covers the needs for “publication quality outputs”. The recent developments focused on a better match with the screen output:

• Better matching of marker sizes.• Text kerning.• Text centering (when rotated).

And several other small improvements

It should be noticed that many of the TPostScript changes have been related to text output.

Overall PS/EPS output is ok

What is needed ?

To improve the matching with the screen output and to have more fonts: the possibility to load TTF fonts in PS files.

Page 4: “Paper” output Root Graphics Workshop 16/07/2010.

PDF Status

TPDF is more recent than TPostScript, but now it has almost the same functionalities. The quality is the same as PS, it can be easly included in publication (LaTex) and usually the files are smaller because part of the pdf code can be compressed. So it is widely used, at least as much a PS, may be more.

Recent developments:

• Text kerning.• Table of content.

What is needed?• Like for PS the possibility to load TTF fonts.• In TPostScript has been implemented the possibility to render images produced by TASImage in some compact way. Being a programming language this was possible with PostScript. This is more tricky with PDF, but it has to be done.

Page 5: “Paper” output Root Graphics Workshop 16/07/2010.

SVG Status

SVG (Scalable Vector Graphics) is an XML-based file format allowing to include vector graphics in HTML pages. The basic has been implemented. TSVG is not yet at the level of TPostScript. TSVG works quite well for simple graphs but, because SVG is very verbose, it generates huge files when, for instance, many lines or markers are drawn.

Right now there is no urgent requests to be implemented. May be some will show up if SVG is more widely used.

What is needed?

• Complete de implementation. Several things are missing like for instance the fill patterns

Page 6: “Paper” output Root Graphics Workshop 16/07/2010.

Binary files status (TASImage)

Nearly all the binary files formats are supported by libAfterimage: GIF, TIFF, JPEG, PNG etc… therefore they are all available in ROOT.

In the past few months an effort was made to really make the binary file output looking like the screen output. There was several discrepancies which have been fixed. Some small details might still need to be fixed, but basically there is not major problems.

What is needed?• Follow the libAfterimage development, and test and take in ROOT the new developments (from http://www.afterstep.org/afterimage/).• Pictures having some transparent part (gif and png) are not transparent when displayed in ROOT (Timage::Open).

Page 7: “Paper” output Root Graphics Workshop 16/07/2010.

GL Scene Output

• OpenGL does need is a connection to X to be able to negotiate GLcontext/buffer via the GLX extension. So batch mode will not work.

• Saving a scene a TPadGL scene for the screen into a binary file works.

• Saving a TPadGL scene in a vector graphics file is more tricky. Until now it has been implemented only for PostScript using GL2PS. But this generates very big files. There was some ideas to use the TPainter3DAlgorithms to render legos and surfaces. But then the result on paper may look different from the one on screen.

We had some idea to replace completely X11 by OpenGL. For the “output on files” point of you this will mean:1.For 2D graphics this will fly. The rendering on screen can be done by OpenGL and the rendering on files can be done like now in interactive mode and batch mode using gVirtualPS.2.For special rendering options provided by TGLPlotPainter saving on files works only in interactive mode, for binary files, and for PostScript using GL2PS.3.For 3D graphics like TEVE, saving on files works only in interactive mode, for binary files.