Legends: Raster Images

This topic is a companion to the main Legends topic. Please review the Legends topic and the Legends: Tutorial Example topic before proceeding with this topic.

Legends for Images (Rasters)

Images in Manifold are all sorts of raster data, and are also called rasters.  When we create a legend automatically using Create Legend for a frame created from an image,  the legend created depends on the type of image.  


Legends created for single-channel images, such as rasters that show terrain elevation surfaces can be very useful, automatically-created legends for palette (indexed) images can be useful with a bit of tinker time, and legends created for RGB photographic images might not be useful at all and better replaced with a caption using a text frame.

Single Channel Rasters

Single channel images typically display data, such as terrain elevation, temperatures or other data shown in a heat map display.  The automatic legend will be created based on the Style intervals used to style the image.



For our example we use a single channel raster called Hills that shows terrain elevations near Livermore, California, using the Style shown at right above.  



If we add that image to a layout as a frame, Alt-click it to make it active, and then choose Create Legend, the automatically created legend will look like that seen above.   For our example, we used a blank Caption in the New Legend dialog, to create a simpler legend.


The many decimal places in the legend come from the Style dialog, where automatically created, equal intervals were used.  



If we prefer no decimals, we can easily edit the Style dialog for round numbers in intervals, as seen above.  Press Update Style.



Now when we automatically create the legend it will have the same numbers as the Style dialog, round numbers without many decimal places.

Palette Images

Palette images reduce the number of colors used in the image to 256 colors and then using one number per pixel (one channel) to specify the color for each pixel. Each color number corresponds to a color in a palette of 256 colors. Each color in the palette is an RGB color out of a possible range of millions of colors.  Besides saving space, an important raster data usage of palettes is to force pixels into a pre-defined set of color values. Such values can represent various classification schemes for the physical regions or data values represented by the pixels.   Palette images are known as indexed color mode images in Adobe PhotoShop.


When creating a legend automatically for a frame that contains an palette image, the system will create 256 sample frames in the legend, one for each possible color used.  We select those frames not necessary and delete them.  Since it is easier to select and quickly delete many frames, that is easier than adding many legend frames individually.



We take a sample image that is a palette image using eight colors, originally saved in .png format and imported into Manifold.  Once imported into Manifold even though only eight colors are used from the available 256 color slots in the palette, the palette image is set up with a 256 color palette.



Using Create Legend creates a very long legend with most frames jammed together in a jumble at the bottom edge of the layout sheet.   We can see that eight colors, from 0 to 7, are used by the image.  


We will delete unnecessary frames, from 8 onward.



The Layers pane shows how there are 256 legend sample frames (they are labeled beginning with the 0 frame).    We Ctrl-click the last frame to select it.



We scroll to the top of the Layers pane and Shift-Ctrl-click on the sample frame labeled 8.   That selects all frames in between as well.  We press the Delete button in the toolbar to delete the unwanted frames.



That reduces the legend down to a small size.   For now, we have turned off the base frame.  In real life, we would use Resize to Selected to wrap the base frame exactly around the other frames in the legend.



The legend now shows the colors used in the image, and the index number for each color.

RGB and other Multichannel Images

Using legends to show all colors within RGB images is not a realistic proposition, since there can be millions of different colors.  Manifold's automatic legend creation for RGB images and other multichannel images is experimental, a work in progress, and is designed to show the ranges of absolute values that occur in channels, to show where spreading or other techniques are used to enhance contrast in one or more channels.



We being with an RGB satellite image showing St. Peter's in Rome.  This is the same image used in the SQL Example: Process RGB Images using Matrix Filters topic.



By default, RGB images are styled using a 0 to 255 range for each channel.     When multichannel images use the same values for each channel, the automatic legend builds only two frames, indicating that all color channels range in value from 0 to 255.



The legend is not particularly useful, at first sight, but a range from 0 to 255 does indicate the size of data in each channel used (as opposed to showing ranges from 0 to 16383).  Future builds are expected to improve the presentation.


More useful are presentations that have different values in the range boxes for the three different channels.  In that case, the automatic legend will build three frames, one for each of the channels, that present the ranges used.



Suppose we have altered the Style for the image applying high autocontrast for Channel 2 (red), low autocontrast for Channel 1 (green), and low autocontrast for Channel 0 (blue).  



The legend automatically created by Create Legend will build a sample frame for red, green, and blue channels and will show the ranges of values used in the range boxes for each.   The higher contrast used in the red channel results in a rose tint to the image.


Legends automatically created in such situations will usually require some tinkering, to make the frames taller or wider to fit the text.   If we do not want so many decimal places used in the numbers, we can use simpler numbers in the Style dialog.



The legend, after all, truthfully reports what Style is used.  If we use whole numbers like the above, Create Legend will use those as well.



The result is a smaller, simpler legend.   In real life, we would add some text frames for captions to state what the numbers are.


See Also





Layers Pane




Layouts: Info Pane


Layouts: Create Commands


Layouts: Alignment Commands




New Legend


Legends: Tutorial Example




Style: Thematic Formatting


File - Page Setup


File - Print


File - Print Preview


Example: Layout Properties - Editing properties which appear in the mfd_meta table for a layout changes the content of that layout.   We can exploit that effect to create standardized layouts which are then re-cycled for different content.