Asymptote FAQ - Section 9
Questions about output


Question 9.1. How can I disable automatic invocation of the PS viewer after an asy file is done processing?

It's actually not on by default, unless you happen to be using Microsoft Windows (because that is what most Microsoft Windows users expect). Microsoft Windows users can turn this feature off with the command-line option -noV or by putting
import settings; 
interactiveView=false; 
batchView=false; 
in their config.asy file. See http://asymptote.sourceforge.net/doc/Options.html.

Question 9.2. How do I output jpeg images?

If you have the ImageMagick convert program installed, simply type
asy -f jpg test.asy 

Question 9.3. Can I embed bitmaps (photos) into my drawings and position and scale them?

Convert them to eps format and use the graphic(string) function just like a Label:
label(graphic("file"),(0,0));
See the example http://asymptote.sourceforge.net/gallery/orthocenter.asy and http://asymptote.sourceforge.net/doc/label.html.

Question 9.4. Does Asymptote support direct PDF output?

Currently, PDF conversion is possible with the -f pdf option, which supports transparency, annotations, and embedded movies and u3d images. However, we plan to eventually produce direct PDF output to support features not available in PostScript (e.g. general function shading).

Question 9.5. How to I produce large pictures of high quality in raster format (e.g. png, giff etc).

Try using some of the options to convert, mainly -geometry and -density. For example: convert -geometry 1000x3000 example.eps example.png should give you the number of pixels you are looking for.

You can also change the default resolution of the image with: convert -geometry 1000x3000 -density 300 -units PixelsPerInch example.eps example.png This does not change the number of pixels in the image, but just gives a hint as to how large a pixel should be displayed.

If you include the -density option without the -geometry option, convert will keep the image size constant (so a 4"x3" eps figure will generate a 4"x3" png image).

Question 9.6. Is it possible to produce multi-page documents with asymptote?

Yes, simply call the newpage() function. This is used by the slide.asy package to produce high-quality slide presentations (easier to use than Prosper).
Back: Questions about differences between Asymptote and MetaPost.
Return to contents.

Asymptote - 01 November 2006

Extracted from Asymptote Frequently Asked Questions, Copyright © 2006 .