What is the Best Graphics Format to Export as?


Authored By: Mark Nicholson

What is the best graphics format to export as?
Question: I see that Zemax can export in BMP, JPG and metafile format. Which is best?



To some extent, this depends on the target program you want to import the graphic into. Almost all programs can import BMP and JPG files. These are screenshots of the Zemax window, saved in either BMP (no compression, no loss of quality) or JPG (good compression, very slight loss of quality) formats. As these are screenshot-based, the file size and resolution are defined by your screen resolution and the size of the Zemax window when the graphic was exported.

Metafiles however are the raw graphics command language used to create the window. They are effectively resolution-independent. Here for example, an MTF window is exported as a BMP and as a metafile, imported into Microsoft Word, and then viewed at a zoom factor of 500%:

Bitmap Export:


Metafile export:


You can see that the BMP export, being a fixed resolution, does not zoom well. Note that Metafile export is not available for the OpenGL graphics windows (Shaded Model, NSC Shaded Model, Object Viewer) as these are generated directly as bitmaps.

Since BMP and JPG exports are based on screen captures, things can be tricky when using the ZPL macro commands EXPORTBMP and EXPORTJPG in a long macro when the screensaver kicks in, and particularly if the user account is logged out due to 'inactivity'. Power management software in general is a nuisance for the engineering/scientific computer user, because it usually judges 'activity' solely on keyboard and mouse usage. Leaving long Zemax simulations running can lead Windows into shutting down parts of the computer that are actually in use.

We recommend you use EXPORTWMF if a screensaver or account lockout is likely to be triggered over the duration of a macro's execution. Metafile export is not based on screen capture. Alternatively,  save the data and not the graphic of the data in these cases. 

Also, we have found saving screenshots of the OpenGL windows unreliable when running Vista/Windows 7 'Aero' theme. For maximum reliability, especially when running unattended (i.e. when using a macro) we recommend you NOT use the Aero theme if you want to export the Shaded Model, NSC Shaded Layout or Object Viewer. All other Zemax windows export fine under Aero.







© All Rights Reserved.