Edit - Save as Image

This command appears when a map, drawing,  image, or labels window has the focus, and enables saving the view in the window as a image component that captures the visual display in that window.   The Save as Image  dialog opened by the command renders the contents of the window into a four channel (BGR, plus Alpha channel for transparency) image of the specified size. The image is created in the data source of the map.  The default name for the image is <window name> Image.    

 

Created images are fully georeferenced, using the same coordinate system as the map window from which they were created.  That makes it possible to immediately use the images as layers in Manifold, or to export them using a coordinate system aware format such as GeoTIFF for use in other GIS packages.

 

Images created also contain a fourth, alpha channel, that specifies the transparency of each and every pixel individually.  That fully preserves all transparency effects when multiple layers in a map that have different opacity settings in the Layer pane are combined to create a visual display.   When saved into a format, like PNG, that respects alpha transparency, the resulting image can be used in graphics arts editors like PhotoShop or GIS packages like Manifold as a layer where the transparency of each individual pixel will be respected.

 

To create an image from a map window

 

  1. Open a map.  Undock the window and resize it to a convenient size.

  2. Pan and zoom the map to the view desired.

  3. Use the Layers pane to turn on desired layers, including any virtual layers, and to arrange layers as desired.

  4. IIn the main menu, choose Edit - Save as Image to launch the Save as Image dialog.

  5. Enter a Name for the new image if the default name "Map Image" is not desired.

  6. Choose the View mode desired.  

  7. Set the desired Size in pixels, using the Current Window or Current Scale button if convenient. The dialog will report the approximate size of the resulting image in bytes.

  8. Check the Render virtual layers button if virtual layers are to be included.

  9. Press Render to create the image.

  10. A new image and the image's table will appear in the project. The image will be highlighted, ready to be opened or copied if desired.

  11. The new image will be georegistered to the coordinate system of the map window from which it was created.

 

Creating an image using Save as Image tracks progress and, for windows that have multiple layers, reports the name of the layer that currently being rendered during the process. This allows seeing which layers take a long time to render.  Usually web server images like Bing or Google are the slowest to render.  Rendering can be canceled at any time. When rendering is canceled, the system waits for any database or web requests that have already been started to either complete or fail.

Options for View Mode

Dialog using current view (the default) mode:

 

 

Dialog using centered view at current scale mode:

 

 

Dialog using full view mode:

 

 

Dialog using custom view mode:

 

Controls

Name

Choose a name for the new image.  The default name for the image is <window name> Image.   The created image will be saved in the data source that hosts the component for which the image created.  If that data source is a linked data source, that is, not within the current .map file, the data source in which the image will be created is named in the default name, using <data source>:<window name> Image as the name.

View

Choose the view mode used to generate the image.  Available modes:

 

  • centered view at current scale - Renders data from the center of the current view at the current scale out to the given extents.
  • current view - Renders data within the rectangular area shown in the window into an image of the specified number of pixels horizontally and vertically.  Increasing the number of pixels increases the resolution and thus detail.  This is the default mode.

  • full view - Renders data in the rectangular area that covers all layers that are turned on except base maps (the same area that Zoom to Fit would show) with the desired level of detail.

  • custom view - Press the Edit button to choose custom extents for the view.  You can choose custom view to set X and Y coordinates for the view rectangle, current view to use the current view's extents, full view for the extents of all visible layers except map server base layers, or choose one of the layers in the map (visible or not) to use that layer's extents.

 

The easiest way to save an image is to use current view mode to capture the map window display as it looks in the view currently shown in the window.

 

Size

Width (X) and height (Y) in pixels of the image to be created.   The current view, full view, and custom view modes only allow editing the X size, with Y size automatically being set to be proportional to the dimensions of the render area.  The centered view at current scale mode allows setting both X and Y size, with the view that is captured for the image expanded out to that width and height in pixels at the current scale.   The maximum allowed value for either X or Y size is 25 million pixels (the limit is not a technical limitation but a sanity check).

 

The Current Window and Current Scale buttons will automatically set the Size values.

Current Window

Appears with current view and centered view at current scale modes.   Sets the size of the image in pixels to the size of the current window.  Provides a quick way to get back to the default setting If we change the size of the image in pixels and then change our minds and want to get back to what it would be for the current window.

Current Scale

Appears with full view and custom view modes.   Sets the size of the image in pixels to the size of the view at the current scale.   Appears for custom view mode by default because the default size of the image in pixels for custom view is that of the current view in the window at the current scale.  Provides a quick way to get back to the default setting If we change the size of the image in pixels and then change our minds and want to get back to what it would be by default.

<size readout>

The approximate size of the uncompressed RGBA image that will be generated

Edit

Appears with custom view mode.

DPI

Set the dots per inch (DPI) resolution at which vector shapes and text will be rendered.  The DPI value is used to scale styles for vector objects in drawing layers, labels, and also shapes and text in virtual layers such as north arrows, scale bars, legends, and grids.  
 
When choosing a DPI higher than 96, the default for screens, increase the width and height in pixels of images beyond that set by default for the current window or current scale to handle the increased DPI.  For example, when specifying a DPI of 600, about six times greater than the monitor default of 96, the width and height in pixels should be increased by a factor of six to maintain proportions.
 
Rendering web images such as Bing retrieves image data as if the DPI was at most 96, to make the vector shapes and text in retrieved data sized similarly to other layers.

Render virtual layers

Render virtual layers (North Arrow, Scale Bar, Legend, Grid, and Background virtual layers) that are turned on in the Layers pane for the window.  If the option is turned on, the system renders into the image those virtual layers that are currently turned on in the Layers pane.  If the option is turned off, the system ignores the virtual layers.  Note that turning this option off will not render the virtual background layer: that means that the "white space" between objects in vector layers will be transparent, resulting in transparent pixels in the corresponding part of the generated image.

Render

Press to render a new image based on current settings in the dialog.   A new image and the image's table will appear in the project, created in the data source of the map. The default name for the image is <window name> Image.

Edit Query

Open a Command Window loaded with the SQL query that generates the image to be created based on current settings in the dialog.  This is a great way to learn how to use the TileRender... SQL functions that generate images.

Close

Exit the dialog without creating any images.

 

Edit View dialog:

 

 

Typical dropdown layer choices for the Edit View dialog.

 

Controls

(choice of view or layer)

Choose the desired view to enter extents:

 

  • custom view - manually set X and Y coordinates for the view rectangle.
  • current view - automatically enters the current view's extents as X and Y coordinates for the view rectangle.
  • full view - automatically enters the extents of all visible layers, except map server base layers, as X and Y coordinates for the view rectangle.
  • <layer> - choose one of the layers in the map (visible or not) to enter that layer's extents as X and Y coordinates for the view rectangle.

 

X

Enter the minimum and maximum X coordinates of the view as projected coordinates, in units used by the coordinate system with local offsets removed.

Y

Enter the minimum and maximum Y coordinates of the view as projected coordinates, in units used by the coordinate system with local offsets removed.

 

Opacity

Images created by Save as Image are four channel images that include an alpha channel to encode a full range, 255 levels, of opacity (transparency).   When the map from which an image is made contains layer opacity settings for layers that are other than 100% full opacity, the saved image will correctly display all opacity effects resulting from the combination of various layer opacity settings in the map.

 

We can see that using the following example.

 

 

Consider the map shown above, which consists of four layers, three drawing layers and a labels layer.   The triangle layer and Provinces layer both use partial opacity, so what is below those layers can be seen through objects in those layers.

 

 

The Layers pane for that map shows that the triangle layer is rendered with only 50% opacity while the Provinces layer is rendered with 80% opacity.   The Background virtual layer is turned off.  With the Background virtual layer turned off, we see the checkerboard "transparent" background in locations that are not covered by vector objects in the other layers.

 

 

To create an image that captures the display shown in the map window, we choose Edit - Save as Image.   We name the new image Varying Opacity Image and otherwise use default settings.  Note that we do not check the Render virtual layers box since there are no virtual layers we want to capture in the image.

 

Press Render to create the image and the image's table in the Project pane.

 

 

Open the image in its own window, and then use the Windows option in the Locations button in the main toolbar to pan and zoom the view in the Varying Opacity Image window to be the same as the view as the original Map window display from which the image was created.  That allows easy comparison of the created image to the orginal map display from which it was created.

 

The image's window shows white background, since by default the Background virtual layer is on in windows using white color as a background.

 

 

We can change that in the Layers pane by quickly unchecking the Background virtual layer.  Note that there is only one real layer, the image, in the Layers pane for the image window.

 

 

Unchecking the Background layer shows that the image we created exactly captures the display that was shown in the map window.  

 

But how does the image handle the varying levels of opacity in the original map window?   We can see how by zooming into the image and Alt-clicking a tile to pick a region of pixels that we can examine more closely in the Info pane.

 

 

We Alt-click a location in the south of France, to pick an image tile shown by the picked blue outline and corner handles.  Clicking anywhere within that picked tile puts the focus on an individual pixel in the Info pane.   In the illustration above, we have clicked a pixel offshore from France, in a location where there were no objects in the original map.  The active pixel is shown with a larger, square blue box icon.

 

 

In the Pixels tab of the Info pane we can see the channel values for that pixel: all three color channels (Blue, Red, Green) are 0 and the alpha channel is 255.  

 

We can understand the value of alpha channels in opacity by thinking of it as giving transparency, where a maximum value of 255 is full transparency and a minium value of 0 is no transparency, that is, a fully opaque pixel.   The pixel we clicked has an alpha value of 255, which means it is fully transparent.    If we combined this image in a stack with other images or vector layers, anything below that pixel would be completely seen through that pixel with no change from that pixel for anything seen below.

 

 

Suppose now we click a different pixel, one that is located within a Provinces layer object, an area, in the original map window.   The pixel is not located in a region overlapped by either the yellow triangle, by one of the blue lines, or by a label.  It is located only where a Provinces object was rendered in the original map window using an opacity of 80%.

 

 

The BGR color values for that pixel are 165, 193, 102, a shade of green-blue color, and the alpha value is 51.     An alpha value of 51 is 80% of the way from full transparency at a value of 255 to no transparency at a value of 0.

 

If the image was shown as a layer above some other layer that was fully opaque that contained blue objects like the opaque blue lines in the oringal map, those blue lines would show through regions of purely green blue Provinces color to form the same composite shade of more-blue color seen in the image where the opaque blue lines objects in the original map passed under the Provinces layer.

 

 

Suppose we now click a pixel in a spot where only the yellow triangle is rendered in the original map window.  Pixels in spots like that are rendered in the original map window using 50% opacity.

 

 

The BGR color values for the clicked pixel are 0, 215, 255, a shade of light yellow color, and the alpha value is 127.     An alpha value of 127 is 50% of the way from full transparency at a value of 255 to no transparency at a value of 0.

 

 

We next click a pixel in a spot where the yellow triangle overlaps a Provinces area object, but in a spot where there are no overlaps with opaque layers like the blue lines or labels layers in the original map window.   Pixels in spots like that are rendered in the original map window using a combination of the 50% opacity of the yellow triangle layer and the 80% opacity of the Provinces layer.

 

 

The BGR color values for the clicked pixel are 73, 205, 187, a shade of yellow-green color, and the alpha value is 25.   An alpha value of 25 is 50% of the alpha value of the Provinces layer pixels alone, 51, which are 80% of the way from full transparency at a value of 255 to no transparency at a value of 0.    The combination of a 50% opaque layer over an 80% layer is 90% total opacity

 

 

Finally, we click a pixel in a spot where the yellow triangle overlaps a Provinces area object, and also where there is an overlap with the opaque blue lines layer in the original map window.   Pixels in spots like that are rendered in the original map window using a combination of the 50% opacity of the yellow triangle layer,  the 80% opacity of the Provinces layer, and the 100% opacity of the blue lines layer, for a total opacity of 100%.

 

 

The BGR color values for the clicked pixel are 88, 196, 175, a slightly bluish shade of yellow-green color, and the alpha value is 0.   An alpha value of 0 is 100% of the way from full transparency at a value of 255 to no transparency at a value of 0.

 

Notes

Rendering Labels - The Save as Image dialog allows specifying a view that is different from what is displayed onscreen in a window, which can involve significantly different numbers of labels and label overlaps.  Big images are rendered in parts, with label placement automatically adjusted to avoid part boundaries to ensure labels are rendered without any boundary artifacts.  The system adjusts placement for labels that would normally be placed on a part boundary by attempting to move them to alternate locations nearby.  If that fails, for example, due to label overlap settings, the label will be suppressed.     

 

Rendering Functions and Empty Rectangles - The Save as Image dialog uses the TileRenderXxx SQL Functions, as can be seen by pressing the Edit Query button to create a query that renders the desired image.  All TileRenderXxx query functions require the render rectangle to be non-empty.  When computing the render rectangle from component data, watch for cases where the rendered component is empty. The Save as Image dialog in such cases sets the render rectangle to [ 0, 0, 1, 1 ] so that an empty component still renders and produces an image.

 

Not a replacement for Layouts - The Save as Image dialog is a great way to create images that will be used in other software packages, for example, for use in Microsoft Word as illustrations, on web sites, or in other GIS or CAD packages.  But when it comes to created printed materials or PDFs from Manifold, using Layouts is often a better choice.   

 

Instead of generating an image using Save as Image to create an image from a map and then adding that image as a frame in a layout, add the map itself as a frame to the layout.  That provides on-the-fly dynamic updates that a static image cannot provide.  Use Render Scale in the Layers pane with the map layers to "lock" layers to desired scales if that is how you want the map to be rendered in the layout frame, while letting the layout handle DPI based on printer settings.  That can be a simpler approach than manually choosing the number of pixels in the width and height of an image, and specifying matching DPI settings in the Save as Image dialog.

 

Videos

5 Minute Tutorial - DPI in Save as Image  - A quick look at using the DPI setting in the Save as Image dialog.

 

5 Minute Tutorial - Custom Views in Save as Image - The video shows how to use custom views in the Save as Image dialog, including a fast and easy way to create images that cover only those regions within a grid or within a rectangle drawn.

 

First Look - Save Map Views as Images - A quick introduction to using the Save as Image dialog.

 

See Also

Maps

 

Drawings

 

Images

 

Layouts

 

Layers Pane

 

Layer Opacity

 

Render Scale

 

Example: Assign Channels - How to use the Style pane for images to assign channels to display outputs such as R, G, B or A.  This topic shows examples of channel combinations and the visual results.

 

Example: Set Image Transparency using Alpha - The A row in the Style pane allows us to specify what transparency we want to apply to the image, either by applying the same value for A for all pixels or by using one of the other channels to also control the A value.