Visualization Guide
Visualization Guide
Visualization Guide

Saving Rendered Images

You can save your rendered images to disk using the Save Image dialog box.

In addition, you can use the Save Multiple Images dialog box to render multiple images and save them to disk. This can be done from within the MicroStation environment or from the system command line.

You can save rendered images as follows:

To save a rendered image
  1. From the Utilities menu's Image submenu, choose Save.
    The Save Image dialog box opens.

    Save Image dialog box

      

  2. From the View option menu, choose the source view.

  3. From the Format and Compression option menus, choose the format and compression level required.

  4. From the Mode option menu, choose the number of colors.

  5. From the Shading option menu, choose the required rendering method.

  6. From the Shading Type option menu, choose the required rendering type.

  7. Where, Shading is Ray Trace, Radiosity, or Particle Trace, choose the required Action from the Action option menu.

  8. (Optional) In the Resolution fields you can specify a different value to the default that appears.
    Defaults are calculated according to the aspect ratio of the selected view (its height relative to its width). Changing either the X or Y value automatically changes the other.

  9. (Optional) In the Gamma Correction field you can specify a different value to the default that appears. Higher values will lighten the image, while lower values will darken it.

  10. (Optional) To set up to render an image in parts (bands), turn on the Render Image in Bands check box and adjust the settings in the Banded Rendering section. Banded rendering only works with true color (24-bit) or RGB Alpha rendering and does not support JPEG format. See Rendering images in bands.

  11. Click the Save button.
    The Save Image As dialog box opens. By default, the image file is given the same name as the design file, but with a suffix matching the format (for example, “.tif” or “.rgb”).
    If the image is to be rendered in bands, do not enter an extension.

  12. Click the OK button.
    Rendering commences and the image file is saved.

Screen capture and dithering

If your system cannot simultaneously display all the required colors, rendered images are dithered to simulate the extra colors. Dithering is the creation of a pattern of pixels, using available colors, to approximate any unavailable color(s).

With screen capture you are limited to the number of colors and resolution your monitor can display. You should save images rather than use screen capture if a high-quality image is required.

Rendering images in bands

Because of memory limitations it can be difficult to render high resolution images in order to save them to disk. Consider that during the rendering process, an extremely large image with antialiasing can exceed tens of megabytes in working size prior to its completion. For example, a 2000×2000-pixel antialiased image requires 48 MB of RAM to process.

You can overcome such memory limitations by using the Render Image in Bands option in the Save Image dialog box. The banded rendering process breaks up the image into a series of bands. Each band is then, in turn, processed as individual images within RAM and written to disk as a rendered band file. Upon completion of the last band, all of the rendered band files are combined into a single, finished image file, and the rendered band files are then deleted.

Banded rendering only works with true color (24-bit) or RGB Alpha rendering and does not support the JPEG format.

Settings for banded rendering

The following settings in the Save Image dialog box affect banded rendering:

Files created by banded rendering

During a banded rendering process, the file extension is used to identify individual rendered band files during the rendering process. The file naming syntax is “<image_file_name>.b##,” where ## is a sequential hexadecimal number (0-F) starting with .b00 and running through .bff (a maximum of 256 possible bands per rendering). Because of the potential of overwriting existing files with similar extensions, it is recommended that these band files be stored in a separate directory. This directory is identified with the configuration variable MS_IMAGEOUT (Image Output in the Rendering/Images category of the Configuration dialog box).

For example, when banded rendering is being used to render and save a 2000×2000-pixel image with the banded memory set to 8 MB, 22 band files are created.

In addition to the rendered band files, the banded rendering process creates a temporary control file named “<image_file_name>.bnd.” This file contains the rendering settings, the total number of bands to render, and the number of bands thus far rendered.

Error recovery

Rendering an image in bands and writing each band to disk makes it is possible to recover from an interruption in the process.

To restart a banded rendering after an interruption
  1. From the Utilities menu's Image submenu, choose Save.
    The Save Image dialog box opens.

  2. In the Banded Rendering section, click the Continue button.
    The Continue Banded Rendering dialog box opens.

  3. In the Files list box, select the control (“.bnd”) file.

  4. Click the OK button.
    The Continue Banded Rendering dialog box closes and focus returns to the Save Image dialog box.

  5. Click the Save button.
    The rendering process resumes starting with the next unfinished band.

Using multiple systems

The Render Image in Bands option lets you use multiple systems to render and save a single image. All of the systems must be connected to a common networked file system.

The system on which the banded rendering process is initiated creates the control file on the shared network drive. The Continue button in the Save Image dialog box (see To restart a banded rendering after an interruption) is used on subsequent systems to continue the processing with the first unrendered band. After the last rendered band file in the series is created, the system by which this file was generated combines all of the previous bands together and creates the final image file. This system also deletes the individual rendered band files.

Saving multiple image files

As well as saving single image files, you can set up your system to save a list of images. This is useful for creating and saving rendered images, automatically, when the system normally is not being used, such as overnight. For this procedure, you create a script that contains the names of the files to be rendered along with the view number, or the saved view to be used.

To render multiple images
  1. Set up views to be rendered in the desired designs.

  2. Before closing each design file:
    From the File menu, choose Save Settings.
    or
    Use MicroStation's Saved Views utility (Utilities menu > Saved Views) to name and save the views.

  3. From the Utilities menu's Image submenu, choose Save Multiple.
    The
    Save Multiple Images dialog box opens. If a script file is found that has the same name as the DGN, then that will be opened.

  4. Use the controls in the dialog box to build the image script file, which is an ASCII text file containing entries that define the names of design files, views, output filenames, rendering options, and image formats. See Building image scripts.

  5. Click the Execute Script icon.
    or
    From the dialog box's File menu, choose Execute.
    As a script entry is processed it is highlighted in the list box.

Output File Name macros

Output File Name macros provide a convenient way to format the output file name based on information about the script entry. When the script entry is executed, the macro definitions are replaced with corresponding properties of the script entry. The following table shows the macros that are available. These macros may be keyed-in manually, or selected from a right-click menu in for the Output File name field.

Macro

Expanded value

%d

DGN file name

%m

Model name

%v

Named view, or view group name

%n

View number

%r

Render mode

%s

Render setup name

%e

Script entry number

%a

Auto-increment number

A length modifier can be specified by inserting a number after the percent sign in the macro, with the following results:

Typical examples illustrating the use of output file name macros are shown in the following table. All examples below refer to the third entry of a script, using DGN file kitchen.dgn, view number 4, with a render mode of Ray Trace.

Output File String

Output File Name

%d-%n.jpg

kitchen-4.jpg

My %d [%r].jpg

My kitchen [Ray Trace].jpg

%5d [%3r].jpg

kitch [Ray].jpg

%d (%e).jpg

kitchen (3).jpg

%d (%3e).jpg

kitchen (003).jpg

Building image scripts

Menu items and icons in the Save Multiple Images dialog box let you build image scripts automatically.

Typical entry in an image script file. Information from each entry is used by the rendering process to select the design file and view, and to set the rendering mode, output file name, type, and resolution.

  

You can create one or more scripts and save them to disk. As well, you can recall an existing script, or include an existing one with the currently displayed script.

Options for creating scripts are contained in the Save Multiple Images dialog box's File menu and options for editing the open script in its Edit menu. Several of the most commonly used selections are accessible also via icons in the dialog box, plus you can the right-click menu for any script entry.

Once a script has been created, and the entries displayed in the list box, you can selectively enable or disable entries for processing. Only those entries with checkmarks, in the Enabled column, are active and will be processed. Clicking in the Enabled column toggles the checkmarks on or off.

Only those entries with checkmarks in the Enabled column will be processed.

Clicking in the Enabled column, next to an entry, toggles the checkmarks on or off.

  

Working with image script files

The following procedures are used to work with script files.

To create a script file
  1. From the Save Multiple Images dialog box's File menu, choose New.
    The Create Script File dialog box opens.

  2. Use controls in the Create Script File dialog box to select a drive, directory and filename for the new script file.
    These controls are similar to those in the New dialog box.

  3. Click the OK button.
    The dialog box closes. The name of the script file appears in the title bar of the Save Multiple Images dialog box.

To open an existing script file
  1. From the Save Multiple Images dialog box's File menu, choose Open.
    or
    Click the Open Script icon.
    The Open Script File dialog box opens.

  2. Use controls in the Open Script File dialog box to select the drive, directory and filename.
    These controls are similar to those in the Open dialog box.

  3. Click the OK button.
    The dialog box closes. The name of the script file appears in the title bar of the Save Multiple Images dialog box. Entries for the selected script appear in its list box.

To save a script file with the current filename
  1. From the Save Multiple Images dialog box's File menu, choose Save.
    or
    Click the Save Script icon.
    The script file is saved with the filename that appears in the title bar of the Save Multiple Images dialog box.

To save a script file with a different name
  1. From the Save Multiple Images dialog box's File menu, choose Save As.
    The Save Script As dialog box opens.

  2. Use controls in the Save Script As dialog box to choose a new drive, directory and/or filename.
    These controls are similar to those in the Save As dialog box.

  3. Click the OK button.
    The dialog box closes. The (new) name of the script file appears in the title bar of the Save Multiple Images dialog box.

Working with image script entries

The following procedures are used to work with script entries.

To insert existing script entries into the open script
  1. From the Save Multiple Images dialog box's File menu, choose Import.
    The Import Script File dialog box opens.

  2. Use controls in the Import Script File dialog box to select the drive, directory and filename.
    These controls are similar to those for opening a design file.

  3. Click the OK button.
    Entries from the selected script file are appended to the current list of the open script file.

To add a script entry
  1. From the Save Multiple Images dialog box's Edit menu, choose New.
    or
    Click the New Entry icon.
    The Edit Script Entry dialog box opens with the default settings. If an existing entry was selected prior to adding the new entry, then these settings are present in the dialog box.

  2. Use controls and fields in this dialog box to select/modify options such as: Design File, Output File, View, View Number, Rendering Setup (if applicable), Format, Render mode, Shading Type, Resolution, and Banded Rendering options. As you modify settings, they are updated in the Save Multiple Images dialog box.

  3. In the Save Multiple Images dialog box, click the Save Script icon, to save the new entry to the open script.

  4. When creating entries for a script file, make sure that each output file has a unique name, so that they do not overwrite previous images having the same name.

To modify a script entry
  1. In the Save Multiple Images dialog box's list box, select the entry to be modified.
    The entry is highlighted.

  2. From the dialog box's Edit menu, choose Edit.
    or
    Click the Edit Entry icon.
    or
    From the entry's right-click menu, choose Edit.
    The Edit Script Entry dialog box opens with the settings for the highlighted entry

  3. Make changes to the settings as required.

  4. In the Save Multiple Images dialog box, click the Save Script icon, to save the modifications to the open script.

To duplicate a script entry
  1. In the Save Multiple Images dialog box's list box, select the entry to duplicate.

  2. From the dialog box's Edit menu, choose Copy.
    or
    Click the Copy Entry icon.
    or
    From the entry's right-click menu, choose Copy.

  3. If necessary, open the script file into which the entry is to be pasted.

  4. (Optional) Select the entry below which you want to paste the copied entry.

  5. From the dialog box's Edit menu, choose Paste.
    or
    Click the Paste Entry icon.
    or
    From the entry's right-click menu, select Paste.

The script entry is pasted below the highlighted entry in the currently displayed script file.

To move a script entry
  1. In the Save Multiple Images dialog box's list box, select the script entry to move.

  2. From the dialog box's Edit menu, choose Cut.
    or
    Click the Cut Entry icon.
    or
    From the entry's right-click menu, choose Cut.

  3. If necessary, open the script file into which the entry is to be pasted.

  4. (Optional) Select the entry below which you want to paste the cut entry.

  5. From the dialog box's Edit menu, choose Paste.
    or
    Click the Paste Entry icon.
    or
    From the entry's right-click menu, select Paste.

The script entry is pasted below the highlighted entry in the currently displayed script file.

Rendering multiple images from the command line

You can also execute image script files from the system command line.

To render multiple images from the command line
  1. Build the image script file (see Building image scripts).

  2. Exit MicroStation.

  3. Set the MS_INITAPPS system environment variable to “savemult”.

  4. At the system prompt, enter: ustation -iSAVEMULT=<script_file>

  5. Be sure to unset the MS_INITAPPS system environment variable after the rendering has completed.