Images

 

icon_image.png Images in Manifold provide a visual display of all sorts of raster data, including photographic images, aerial photographs, satellite images, and more data-oriented raster data sets such as terrain elevation data in raster form, multispectral data, LiDAR data and other raster data.    Raster data consist of rectangular arrays of pixels, stored in tables in the form of tile fields.   

 

This topic assumes we have read the Tables topic as well as other introductory topics such as the Getting Started and User Interface Basics topics.

 

i_image_paris.png

 

Images are just a different way to display pixel data that is stored in a table:  an image cannot exist without a table somewhere that has a tile field from which the image draws the information it displays.   The actual image component contains just a few bytes of data that specify which table stores the data to be visualized and what field in that table contains the tile data.  All of the actual pixel data is stored in the table.

 

Raster data can be many types of data, such as terrain elevations, ranges of temperatures, concentrations of chemicals or other data not intended as a photographic image.   Raster components are called images in Manifold since that is a more familiar word in most cultures for pixel-based data.

Layers in an Image Window

Image windows can contain layers just like a map.  See the discussion of layers in the Maps topic.  We can add images, drawings and labels as layers to an image window, for temporary viewing.  A key difference between layers in a map and layers in an image window is that hosting layers is the reason to have maps, while adding layers to an image window is a temporary convenience to allow us to quickly see the image in the context of other layers.    In general, if we want to use layers we should use a map.   It is so easy to add layers to an image window that it is easy to forget they are temporary.   To save work invested into a nice arrangement of layers added to an image window, Manifold provides the Edit - Save as Map command.

 

An image window always contains the originating image as a layer, and the image window will always use whatever projection the image uses.   If we change the coordinate system of the image, the image window will automatically use that different coordinate system as well.   If any other layer is added to an image window, the image window will re-project that layer on the fly into the coordinate system used by the image and the image window.

 

To add a layer to an image window:

 

  1. Open the image by double-clicking it in the Project pane.  

  2. The image will appear as the only layer in the image window.   The image window will use the projection of the image.

  3. Drag and drop any additional desired layers from the Project pane into the image window.

  4. The image window will automatically re-project on the fly all layers into the coordinate system used by the image.

  5. Rearrange layers by dragging their tabs left or right, or by using the Layers panel.

  6. Layers in an image window are temporary.   To save the layer arrangement, use Edit - Save as Map.

 

There are three key differences between layers in a map and layers in an image:

 

 

 

ico_nb_arrow_blue.pngLayers in image windows are temporary:  when we add layers to an image and then arrange those layers in order, if we close the image and then open it again those layers will be gone.  To save the layer structure added to an image, choose Edit - Save as Map and save the window, together with the layers as specified, as a map.

 

Importing or Linking Images

Most images we use will be images created automatically when we import or link raster data from files or data sources that contain images.   Such images will normally be imported using default style, which usually works well for photographic images but which will often require application of Style to provide a useful display of non-photographic rasters.  We can also add layers to help understand the image better.  

 

We now take a quick look at a non-photographic example of raster data as an image to see how layers in image windows can help us understand the data.

 

il_images01_01.png

 

We import an image as described in the Example: Import DDF SDTS DEM Raster File topic.    The SDTS format from which we imported provides coordinate system information so the initial coordinate system is automatically correctly assigned.   

 

il_images01_02.png

 

The Contents pane Component panel reports the image to be in UTM Zone 10 (N).   The image's window therefore also uses UTM Zone 10 (N).    An image's window always uses the same projection as the image.   Any other layers dragged and dropped into the image's window will be re-projected on the fly into that projection for display so they will line up correctly with the image in the image's window.

 

il_images01_03.png

 

We can drag and drop an imageserver layer, in this case Google Terrain, into the image to serve as a background layer to provide context to the image. We can also add a second imageserver layer above the image to provide further context, in this case a Google layer that provides streets and town lables with transparency between the streets and labels so the image below can show through.  

 

Right away we see that this particular image shows data located on the Eastern side of the LIvermore valley in California.     If we have a good eye and we are familiar with Google we will see that the Google layer has a very slightly distorted look.  That is because Google uses Pseudo-Mercator projection, but when the Google layer is seen within this image's window it is being re-projected on the fly into UTM Zone 10 (N).

 

il_images01_04.png

 

To better understand the data we can apply Style as illustrated in the Example: Import DDF SDTS DEM Raster File topic.  

Image Windows Show Data from Tables

All data in Manifold is kept in tables.  Viewing windows like drawings, maps and images do not contain any data: they just visualize data from fields in tables based on what that viewing window has been told to show and how it has been told to show it.   For example, we can have as many images as we want that all show the same data from the same field within a table with each image providing a different Style, a different selection or even a different subset of or different computed values for pixels.

 

Each image opens as a viewing window that displays the data from a tile field in some table.   More than one image can display data from the same table and even from the same field.   The image does not duplicate the data that is in the table; instead, the image just shows the data in the table using whatever are the display properties of that particular image, as specified in the image's Style panel and other dialogs.  For example, two different images can show data from the same table with different contrast settings to show that data.

 

If we copy an image and paste that image we are just making a second copy of the "viewport," as it were, and not making a second copy of the actual data.   The data, as always, stays in the table.  If we want to make a second copy of the data we should copy and paste the table.

Many types of raster data

Images provide a visual display of many different types of pixel-based raster data, data that intrinsically is organized as rows of pixels, and which for the sake of efficiency is stored as tiles in a table.  Each pixel in a raster data set has a value that could be either a single number or a vector numeric value, one of the data types described in the Tables topic.  

 

Ordinary consumer applications like Adobe Photoshop or Microsoft Paint encourage us to think of images as simple RGB images made up of rows of pixels where each pixel shows a color that is defined by the three red, green and blue integer values for that particular pixel.  Most consumer images are small as well, rarely over a few tens of megabytes in size.

 

Raster data encountered in spatial data or other big data can be far larger, easily involving tens of gigabytes of pixels and more complex data where each pixel is a vector numeric value, such as a quad (four numbers) of float64 numbers.  

i_img_aus_radiometric.png

 

Such data might represent not a visual image but scanned data acquired by radar, multispectral sensors on satellites, scanners measuring temperatures and other devices that acquire enormous numbers of pixels at once to gather information about terrain heights, the composition of materials, the species of trees in forests, the temperatures of scenes, the presence of subsurface structures and many, many more applications.    

 

The nearby illustration of Australia around the Gulf of Carpentaria shows gamma ray intensities that reveal the prevalence of radioactive potassium (red), uranium (blue) and thorium (green).  It is a classic example of non-visual data that has been colored in "false color" to convey the data content visually.  At a glance we can see where all three elements are distributed: all three elements abound in white regions, purple regions abound in uranium and potassium but are poor in thorium and turquoise regions abound in uranium and thorium but are poor in potassium.

 

Much raster data, of course, represents a visual image such as a high resolution satellite photo of the sort stitched together in applications like Google Earth.  For example, the image at the top of this topic shows the Eiffel Tower in an image snapped by a satellite.

 

What such raster data sets have in common is that they typically involve large data sets, they often involve some sort of spatial context such as geographic location or a coordinate system (projection) used to acquire the data and they usually can be visualized in some meaningful way by simple relationships between colors and the numbers that are attached to the pixels as values.   

 

In Manifold we use the word image as a synonym for raster data set with the understanding that what we call an image, while it may be conveniently visualized in some way, may just as likely be some abstract raster data set representing non-visual data like temperatures or gamma ray intensities as it may be intended as a visual image like a photograph.  We also will use the word raster as a synonym for image and for raster data set.  

Storing Rasters in Tables

i_img_in_tiles01_00.pngWhen we import a raster data set Manifold converts the pixels stored in the original file format into records in a table, with each record storing a tile's worth of pixels, with an appropriate data type used for the pixels within the tile.  Manifold will then create an image based on that table so we can visualize the raster data in an image window.

 

For example, if we import an image from a file called bronze.jpg that contains an image of a bronze equestrian monument in Paris, Manifold will create a table called bronze Tiles and an image to display the data in that table called bronze.   So why does Manifold store data in tables instead of packing into some sort of image container like regular graphics editors do?   The main reasons are to provide support for very large images, to do so in a way that is orthogonal, that is uses the same sorts of interfaces and approaches as other big data source such as databases and tiled web servers, and finally, to ensure the data can be sensibly reached within a table by SQL and other "everything is a table" mechanisms within Manifold.

 

Storing big data within tables is not as simple as saving each pixel as a single record at the one extreme or, at the other extreme, storing the entire image as one huge blob in a single record.   Fetching big data at the rate of one pixel per record requires far too many fetches of records, each of which is too small.  At the other extreme, storing an entire image in a big blob within a single record in a blob is fine for smaller images within tables containing many small images, but that approach breaks down when images are large: storing 15 GB of pixels in a single record is poor design, with each record being too large.

 

The approach that works best, as many applications independently have determined in their various ways in modern times, is what Manifold does: each image is stored in its own table, with the image data being stored as one tile per record where each tile is some convenient array of pixels, typically on the order of 128 x 128 or similar size.  

 

i_img_in_tiles01_01.png

Consider the illustration above, which shows our bronze sample image, a very small image that requires only four 128 x 128 tiles to store, a mere four records in a table.  The illustrations show the opened image and the opened table for the image, with arrows showing how the tiles that are records in the table compose the image based on where they fit within the X,Y matix that says where the tiles should go.

i_img_in_tiles01_02.png

 

The illustrations nearby  non-square tiles in the actual image because the image size does not evenly divide into modulo 128 by 128 square tiles.  Tiles easily handle that situation at the edges of images where full tiles are not used.  We can see that tiles do indeed store data for regions of an image by setting tow of the tiles to a NULL value.

 

i_img_in_tiles01_03.png

Where the tile values have been set to NULL the image disappears, because there are no pixels in those regions.

 

Using tiles to store image data provides many operational benefits.  To name just a few, we can query data from the middle of a big raster without having to read through many rows or columns of unwanted data, we can leverage sparse storage to avoid wasting storage space where there is no data, we can effectively utilize tiles to build intermediate levels that provide faster rendering at zoom levels other than a native one pixel per monitor pixel and we can increase or decrease the dimensions of a raster image without rewriting the entire raster.

 

Images and Channels

 

Most images we work with will use channels to assign data to Red, Green and Blue display pixels in a monitor.   

 

il_style_image_source01_01.png

 

Starting with an RGB image as seen above, the Ginevra de' Benci by Leonardo da Vinci, the Style panel allows us to manipulate what data is used for which channel.  

 

il_style_image_source01_31.png

 

See the discussion in the Images and Channels topic as well as in the Example: Assign Channels topic.

Importing Compared to Linking

When we import a raster data set Manifold converts the pixels stored in the original file format into tiles stored within a table, with an appropriate data type used for the pixels within the tile.  Manifold will then create an image based on that table so we can visualize the raster data in an image window.     When we link a raster data set Manifold will leave the pixel data in the original file format while the dataport on the fly creates within the project an interface to that pixel data that is, once again, a table with the pixel data shown as tiles plus an image based on the table.   

 

In the case of an import the raster data is brought into Manifold and organized in a Manifold table as tiles.  In the case of a link the raster data stays in the original file or source in whatever original form it is stored or provided while the dataport connecting that source into the Manifold project automatically presents the data as though it were stored in a table as tiles.

 

We can see the translation on the fly into Manifold representation by taking the sample bronze.jpg image used in this topic's examples and linking it into a Manifold project:

 

i_linked_image_bronze_tiles.png

 

Linking the bronze.jpg image into the project creates a new data source with a table, bronze Tiles, and an image, bronze.   If we open the table we see that it has four records, each containing a 128 x 128 tile with a triplet vector numeric value for each pixel that is three uint8 types, the classic way RGB color values are represented for a color image.

 

i_linked_image_bronze_img.png

 

If we double-click open the image we see that it is, indeed, the sample bronze image in our project.   But nothing about the linking process in any way altered the contents of the JPEG file that is the source for what Manifold shows us as a table with tiles or the image created from that table.   The JPEG stays the same it always was, a file full of bytes encoding an image using the JPEG standard but definitely not storing pixels as tiles.   

 

When Manifold shows us the linked image as if it consisted of a table storing tiles that is Manifold computing and translating on the fly to make the data within the JPEG appear to be in Manifold infrastructure form so that we can work with it seamlessly like all other data in our Manifold project.

Palette Images

Many images are visualized by simply taking the values for pixels within tiles and, if they are a single value, displaying them as a monochrome scale from black to white, resulting in a grayscale display, or using triplets of numbers as RGB values or quads as RGBA, that is RGB plus an "alpha" channel indicating a level of transparency.  

 

Another type of image is a palette image, where a single number per pixel is interpreted as an index into a table of colors.  The pixel is colored with whatever color that number indicates in the table.

 

i_img_palette01_01.png

 

If we import an image from a format that stores images as palette images we will see the image appear in the Project pane just like any image, along with the table that stores the data for the image.   The quickest way to see it is a palette image is to use the Style panel, illustrated below in an undocked Contents pane.

 

i_img_palette01_01a.png

 

In the Style panel we can see the image uses a single color channel, Channel 0,  conveying the numbers to be used for he palette shown in the tally pane.   The palette is also exposed via the image's properties in the mfd_meta system table.

 

To see the type of pixel data stored as tiles we can open the image's table:

 

i_img_palette01_02.png

 

For this image each tile is a 128 x 128 array of pixels where each pixel has a uint8 numeric value for the pixel.  With only one numeric value per pixel we know it is either a grayscale image or a palette image.

 

To see the palette used, with the focus on the opened image window we use the Style panel.  


i_img_palette01_03.png

 

In the Style panel we click on the color well to see details about the image style, including the palette.  

 

i_img_palette01_01a.png

 

We can scroll through the tally pane to see the different colors used.  

 

i_img_palette01_04.png

 

The palette shown in the Style panel is fully editable:  by double-clicking into the color wells we can change the colors in use by the palette.  In photographic images we do not normally do that manually, but if we want to we can for special effects or to mark certain zones of color.

 

i_img_palette01_04a.png

 

To change many color wells at once it is quicker to use selection.   We Ctrl-click on the top row desired to select it, and then we Shift-Ctrl-click on the bottom row and all rows in between are selected.

 

i_img_palette01_05.png

 

When we double-click into any of the selected color wells and change it to bright red, all of them are changed from various dark and green colors to bright red.   We click Update Style to apply the change.

 

i_img_palette01_06.png

 

The image will be displayed using the palette as we have modified it to replace the original colors to bright red for the selected palette color entries.

 

See the Palette Images topic for a discussion of palette images.

Intermediate Levels

Large images contain far more pixels than can be seen at once on a computer screen.  A typical monitor with resolution 1920 pixels wide by 1440 pixels high shows less than three million pixels but a 30 GB image can easily have ten billion pixels in it.   

 

When we display an image with ten billion pixels in it on our monitor with a Zoom to Fit command the system cannot show all ten billion pixels so instead it shows an approximate view that fits into the less than three million pixels available.   The approximate view shown is not the real image: it is a summary.    As we zoom further into the big image we see other summaries of the different parts of the big image that fit into whatever is the zoom level we are looking at.   Such summary views are called intermediate levels.   See the Intermediate Levels topic for background.

 

Intermediate levels can take a while to compute: to compute an intermediate level image that will fit onto a typical monitor for an image that has ten billion pixels can take a fair amount of computation.   Manifold, like most packages that work with large images, can reduce that time by pre-computing information for intermediate levels in advance.   That allows much faster panning and zooming.

 

icon_message_red.png

Such pre-computation is normally done on a one-time basis when the image is first imported or linked.   However, if the image changes or otherwise intermediate levels need to be recomputed, we will see a red message icon in the lower right corner of the image.   Choosing View - Messages will show a message that image data for intermediate levels is out of date and will provide a button to update the data.  Until we update intermediate levels we may not be able to see the image at certain zoom levels.

Layers in Images are Temporary

We can add layers to an image window as a temporary convenience and the image window will show those layers like a map window does.   However, while a map maintains its layer structure even after the map window is closed, layers in an image window last only as long as that window is open.   If we close the image window and then open it again, it will have only one layer, the image itself.

 

If we have added layers to an image window and want to keep that organization of layers with the image for later use, we choose Edit - Save as Map to save that window with its collection of layers as a map.    Maps take zero space since in actuality they do not store any data: they are simply references to other components that are the constituent layers of the map.   Therefore, we should not hesitate to ever use Edit - Save as Map to save any interesting or useful collection of layers we have added to an image window.

 

Examples

Example: How Images use Tiles from Tables - An example showing how an image is made up from data stored in a table in tiles.

 

Example: An Image using Computed Fields in a Table - How an image can be created from tiles where the data for the tiles is taken from a field that is computed on the fly.

 

Notes

tech_yoshi_sm.png

icon_message_red.pngTech tip:  If you open an image and do not see anything see if there is a message icon.   If so, choose View - Messages and build intermediate levels if there are none or if they need updating.   It could be that no intermediate levels have been built for that image so it will not appear at the zoom level required to zoom to fit, the default display

 

"That which we call a rose by any other name would smell as sweet" -  So Shakespeare put it in Act II, Scene II of Romeo and Juliet.   

 

What Manifold calls an image may simply be called a raster in other software packages.   Earlier Manifold GIS products up through Release 8.00 used two component types, called images or surfaces, to display raster data.   In both cases the data is raster data and whether that raster data is considered an "image" or a "surface" is more a matter of how it is intended to be used and how it is styled for display.    

 

Raster data intended to be displayed as photographic images, after all, can have one channel or multiple channels.   Raster data that is terrain elevation data might be intended for a variety of purposes, such as building 3D models, but more often than not it is simply displayed as an image of some sort, perhaps styled to be hill shaded and using a palette, but nonetheless displayed as an image.

 

It is really a toss-up whether a software package takes a more technical approach to nomenclature and uses terms like vector data and raster data, or whether it takes the broader approach of referring to drawings and to images, using drawing as a synonym for vector data and image as a synonym for raster data. Manifold takes the latter approach.  Raster data components are called images in Manifold since that is a more familiar word in most cultures for pixel-based data

See Also

Getting Started

 

User Interface Basics

 

Tables

 

Layer Opacity

 

Contents Pane

 

Contents - Layers

 

Intermediate Levels

 

Images and Channels

 

Palette Images

 

Style

 

Style: Drawings

 

Style: Images

 

Style: Autocontrast

 

Style: Palettes

 

Example: How Images use Tiles from Tables - An example showing how an image is made up from data stored in a table in tiles.

 

Example: Create Two Images From One Table - More than one image can show data from the same table, including from the same tile field.

 

Example: An Image using Computed Fields in a Table - How an image can be created from tiles where the data for the tiles is taken from a field that is computed on the fly.

 

Example: Change the Contrast of an Image - In this example we use the Style panel to change the contrast of an image.

 

Example: Using the Assign Channels Button - The Assign Channels button in the Style panel for images allows us to assign channels to the standard three Red, Green, and Blue display outputs using frequently-desired arrangements.   The button provides a short cut way to assign all channels at once instead of doing each channel individually.

 

Example: Assign Channels - How to use the Style panel 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 panel 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.

 

Example: Autocontrast and Hill Shading Images using Style - This example shows how the Style panel can hill shade an image using the values of pixels as heights and generating shadows as if the Sun were located at the specified azimuth and altitude.   This capability is used most frequently with raster images to give an impression of three dimensionality in cases where the values of pixels represent terrain elevations.

 

Example: Style Applied to an Image Server Image - Because the Style panel simply changes the way an image is displayed and not the data, it can operate on read-only data served by various web servers such as WMS REST servers.    In this example we look at every detail of creating a data source using an image server and then manipulating the appearance of the display with Style.  We will connect to a WMS server that provides LiDAR data in various forms, including as terrain elevation.