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 https://asymptote.sourceforge.io/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 https://asymptote.sourceforge.io/gallery/orthocenter.asy and https://asymptote.sourceforge.io/doc/label.html.

Question 9.4. Does Asymptote support direct PDF output?

Yes, PDF output can be produced by the -f pdf option or -tex pdflatex option. This supports transparency, annotations, embedded movies, and U3D/PRC content.

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 
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 each pixel should be displayed.

If you include the -density option without the -geometry option, convert will keep the image size constant (so a 4cm x 3cm eps figure will generate a 4cm x 3cm 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 - 2024-03-24

Extracted from Asymptote Frequently Asked Questions, Copyright © 2024 .