Style: Presenting Images

The Edit - Style dialog manages the display of an image by specifying how data channels are assigned to drive display outputs, which of the values in those data channels should be used and how the possibly very wide range of values in the data should be converted and used for display within the 0 to 255 range utilized to drive display outputs.


The Style dialog for images in Manifold has more controls and deals with data with greater sophistication than typical graphics arts editors for two reasons:


Data comes first - Manifold is all about the data while graphics arts editors are all about visual effects, without caring much, if at all, about data values so long as the desired visual effect is obtained.   In Manifold we use the visual effect as a tool for knowing the data so Manifold provides a much more rigorous and more explicit relationship between actual data values and what is displayed.  Instead of applying a contrast effect known only to the programmer of the package that in some unknown way creates a visual effect, Manifold provides total control for how that contrast effect is achieved.  Manifold allows changing the perceived contrast of the image by changing in specific, explicit ways how the data is mapped to display outputs on each of the display outputs.


More complex data - Consumer graphics arts editors usually work with images that are in conventional, and banal, RGB image format where each pixel consists of three numbers, that is, three channels, each of which contains numbers already in the range 0 to 255 which directly specify the intensity for Red or R, Green or G and Blue or B display outputs.   Manifold is routinely used with multispectral data acquired from sensors such as radar, reflectometers or infrared detectors where an image might have ten channels per pixel with each channel having wildly different numeric values with one channel being in the range of 0.1223 to 0.9234, another being from -16,234 to 84,302 and so on.  A Manifold image might be a raster with a single channel with quantized values that represent values in raster GIS data intended to convey population or vegetation coverage at a given location.   


The Style dialog provides controls for making sense of such data.  For example, there is no need for controls when the raw image RGB data is intended to directly drive RGB outputs, but there is a need for a Method control to specify how to map a range of values from -16,234 to 84,302 in the data to 0 to 255 to drive, say, the Blue display output.


Important: Changing the style used for display does not change the data.  It only changes how the data is displayed when that image is opened in an image window or as a layer in a map window.


Example: change the contrast of an image:


  1. Open the image and choose Edit - Style.
  2. Click on each R, G, B row in turn to highlight it and then for each press Autocontrast and then Update.
  3. Press Apply to see the result.  Press Close when done.


The default Autocontrast spread value of 2 standard deviations provides a good visual result in most situations. If desired, we can change the Autocontrast spread value before pressing the Autocontrast button.  Lower numbers for stdev in Autocontrast spread result in more contrast.   Higher stdev numbers result in less contrast.


See the Example: Change the Contrast of an Image and the Example: Autocontrast and Hill Shading Images using Style topics for examples.

Default Style Dialog


Style Using a Common Color Channel



Common color channel

Check to drive all outputs from a single channel, specified in the Source combo, for all R, G, B and A outputs.

BGR Button

One click channel arranger: Arrange channel to display output for all outputs at a single click.  Choose a setting from the pull down list and then press the button to assign that channel arrangement to the channels list. Typical choices are:


  • BGR - The default.  Assign channels 0, 1 and 2 to B, G and R respectively.
  • RGB - Assign channels 0, 1 and 2 to R, G and B respectively.
  • Grayscale 0 - Assign channel 0 to all three R, G and B outputs.
  • Grayscale 1 - Assign channel 1 to all three R, G and B outputs.
  • Grayscale 2 - Assign channel 2 to all three R, G and B outputs.


If images use the A or Alpha channel or if they have more data channels there will be more options in the button's pull down menu.  See the discussion in the Example: Use the BGR Button to Assign Channels topic.

(outputs and channels list)

A list of Red, R, Green, G, Blue, B and Alpha, A (transparency) display outputs with the channel that is used to drive each output.


Clicking on an output's row in the channels list will highlight it and will choose it as the subject for controls below, automatically locating into the Source box the channel which is used to drive that output.


The source of values to apply to the highlighted output.   Either a data channel or a fixed Value.


How values found within the Source data channel should be applied within intervals to drive the highlighted output.  If the Common color channel box is not checked the default choice is a linear ramp, that is, an output intensity that is a linear interpolation of data channel values falling within the specified Range.  If the Common color channel box is checked a variety of methods will be available that allow classifying values in the data channel into different intervals.

(range boxes)

The lower bound and the upper bound of the range of values to be mapped into the output range.  Pressing Full Range sets these values to be the minimum to maximum found in the Source.   We might set this to a range different than the range of values found in the data.  For example, if the data has all values between 0 and 250 with only one pixel having a value of 9999 we could set a range of 0 to 250.  Autocontrast might use a range wider or narrower than the values found in the data in order to stretch the data further or to displace it lower or higher.   When Autocontrast puts negative values into the minimum range box, it is using a number outside the range found in the data to spread out data values downward.

Full Range

Fill the adjacent range boxes with the full range, from the smallest value to the largest value, of values actually found in the data channel that is selected in the Source box.

Autocontrast spread

The number of standard deviations within which to choose data values from data found in the channel given in the Source box, which data values will be spread through interpolation to fill the range of display values.   See the discussion in the Style: Autocontrast topic.


Compute the range of values found in the Source data channel within the number of standard deviations specified in the Autocontrast spread box and load the lower and upper bounds of that range into the range boxes.  To apply that range, press the Apply button.


Press to update the intervals list using the current dialog settings.


Appears when Common color channel is checked.   Computes bounds, and therefore intervals, based upon the specified Method, Range and Breaks.

(palette button)

Appears when Common color channel is checked. Select and apply a palette to the color values in the intervals list.

(intervals list)

Displays the intervals used to group values from the Source channel into intervals to which specific colors can be assigned.  Editable when the Common color channel check box is checked to edit bounds or to add or delete.  Bounds.

(bounds for intervals)

Specifies the bound for each interval.  Slow double-click to edit.  


Asterisk character in bounds list.   Slow double-click to add another bound and value box.  Adding a bound adds an interval.

(values for intervals)

The value to fill into each interval using the specified Fill rule.   Double-click to edit.  Highlight all rows with a Click or a Shift_click to highlight a range of rows and then right-click to call up a context menu that allows modification of all values at once to Interpolate between highlighted values, Darken all values, Lighten all values, convert all values to Grayscale or to Reverse the order of values.


Fill rules: How colors specified for intervals should be assigned, that is, filled into, specific channel values that occur within those intervals.  See the examples for Fill rules below.


Interpret the values of pixels as heights and adjust colors in the display to simulate the generation of shadows as if a light source were located at the specified Azimuth and Altitude.  Also called hill shading since the normal use is to shade images representing views of terrain to provide a 3D effect, as if the Sun was illuminating the hills and valleys and shadows provided greater relief.  See the Example: Autocontrast and Hill Shading Images using Style  topic.

Z scale

Scaling factor for heights used when Shading is enabled.   Increase the Z scale to increase the relative heights and thus the apparent contrast of shading.


Apply any changes in the dialog to the image.


Close the dialog.   If Apply has not be pressed after any changes have been made then Close will abandon such changes.

Style Applies to a Specific Image

If we like we can have more than one image showing the same data using different styles.   To do so, we Copy the image in the Project pane and then Paste it to create another image that is a copy of the image.   We can then open that copy and choose Edit - Style to change the style.   


When we copy and paste the image we are only making a copy of the image component that specifies how the data in the tiles in the source table should be displayed.   We are not making a copy of the table in which the data (in the form of tiles) is stored.   We can make dozens of copies of an image to use different display styles and that will not increase the size of the project. tech_tina_sm.png


Tech Tip:  Some properties, such as selection, apply to a specific, individual window.   Open that same image or drawing in a different window or and that selection will not be there.    Style properties in contrast apply to a specific, individual image or drawing and will apply in all windows where that image or drawing appears, including map windows where the image or drawing appears as a layer.   Style is about visualization, so it applies only to the image or drawing and does not extend into the tiles or geoms within the table from which an image or drawing is created.  If we create two different images or drawings from the same column in a table we can style those two different components differently.

Displaying Channels

See the Images and Channels topic to learn about channels.   Each pixel in a computer monitor is made up of three tiny dots: a red dot, a blue dot and a green dot.  To display an image the brightness of each dot is varied in 256 steps from a brightness level of 0, meaning the dot is not turned on at all, to a brightness level of 255, meaning the dot is emitting its red, blue or green light as brightly as it can.  In Manifold we call each set of Red, Green or Blue dots the display output. The intensity value used to drive each R, G or B dot is the output value.   Henceforth we will interchangeably refer to Red, Green and Blue as R, G and B.  


Images display data stored in tiles in a table, where each tile consists of pixels that typically, in the case of color, RGB images, have three numbers per pixel.  Each of the three numbers in that triplet is a data channel, with the first number in the triplet being the value for Channel 0, the second number in the triplet being the value for Channel 1 and the third number in the triplet being the value for Channel 2.  Since programs and SQL are frequently used within Manifold we refer to channels by programming-style numbering beginning at 0 so if we have three channels they are called Channel 0, Channel 1 and Channel 2.  


Manifold constructs an image by taking the triplet of numbers for each pixel and then feeding the number for each channel to its assigned R, G or B output.   By convention most computer images use the first number in the triplet, Channel 0, to drive the B output, the second number in the triplet, Channel 1 to drive the G output and the third number in the triplet, Channel 2, to drive the R output.


The Style dialog controls which channels in the data are assigned to drive the R, G and B outputs.    Manifold will automatically assign channels to R, G and B outputs based on storage conventions for well-known image formats.  For example, monochrome images will usually have just one channel, channel 0, which will be used for R, G and B.   Palette images will also usually have just one channel, channel 0, which is used to look up fixed colors from the palette, so it makes no difference how that channel is assigned to R, G or B.


RGB images stored in well-known formats such as JPG will typically have three channels with channel 0 assigned to B, channel 1 assigned to G and channel 2 assigned to R.   Images in formats such as PNG might also have a fourth, channel 3 that gives an Alpha or A value used for per-pixel transparency.   

Ranges and Method

The R, G and B dots on most displays can have only 256 steps of brightness from 0 to 255.  Three-channel images using 8 bit integers within data channels for R, G and B outputs will also have integer values in the channels that range from 0 to 255, so by default when displaying such images Manifold will take whatever value is in the channel and use that value for the brightness value of the corresponding R, G or B dot.  


When images have channels with numbers that are greater than 8 bits per pixel and thus might contain values beyond the range from 0 to 255 Manifold provides two options: first, by default the values in the data channel are interpolated into a range of 0 to 255 using a linear ramp, and second, controls allow us to specify how the range of values in the image will be displayed.  Other controls, such as the box in the upper right corner of the dialog labeled Grayscale in the examples below, allow us to choose quickly between a variety of frequently used channel mapping arrangements.  



Tech Tip:  Do not confuse the use of style palettes in the Style dialog with the idea of images that are palette images.   The two are related notions but distinctively different.   A palette can be used within the Style dialog to color intervals for a image when Style uses a single channel to drive all outputs.   That happens if the Common color channel box is checked.    When Style uses a palette to color intervals computed within the data channel used there is no change in the source data.  Style is purely a visualization effect computed and applied on the fly.   In contrast, a palette image uses a fundamentally different data structure, where the data values found within the image's tiles are index numbers, that is, pointers, into a table, and are not numbers intended to drive display outputs.   The palette image embeds within the image itself a look-up table of colors to use for each index number found in the data.   Those colors in turn specify the output values to use to drive R, G and B outputs.   Although changing the palette, that is the look-up table to use, for a palette image does not change the data values within the channel it does change the data structure of the image itself by replacing the internal look-up table with a different table.


One time pause to compute statistics -   When working with an image for the very first time and applying some Style controls such as Autocontrast the system will pause to computed statistics on pixel values found in the image.   Statistics need to be computed only once for an image and then they are saved within the images data structures.    If images are very large or located on a remote server that is accessed through a slow network link the computation process could require a few minutes.    


Use Style to See Channel Values - We can use the Style dialog to look at the ranges of data in a channel:


Pressing the Full Range button shows the range of values found in the data channel, from lowest to highest.


Entering an Autocontrast spread value of 0 standard deviations and pressing Autocontrast tells us the arithmetic mean of the values found in the data channel.



Why does Style not check the Common Color Channel box for Grayscale images? - Manifold presents all display channels for manipulation even when they are all driven, by default, by the same data channel.  That is done to allow us in advanced uses to alter how each individual display channel interprets the displayed data.


Consider the view of Florida used in the Example: Autocontrast and Hill Shading Images using Style  topic.    The image uses a single channel, the terrain elevation for Florida in that region, to drive all three R, G and B outputs.


If we choose Edit - Style to open the Style dialog for the image we can manipulate each output individually.


For example, as seen above we have clicked on the G output row to highlight it.  That row uses Channel 0 the same as the R and B outputs, using the values from 0 to 255 as a Range.


In the Range boxes we can change the 255 value to 100, press Update and then press Apply.   The intervals list shown above, just after we have pressed Update, shows that the Range we have chosen of 0 to 100 will be interpolated, using a linear ramp, into the output range of 0 to 255.   The net effect will be to make the Green intensities brighter since a smaller range of values will be stretched into bigger values such that a data channel value of 100 will now drive the Green output at an intensity of 255, more than twice as bright.   A mid-range value in Channel 0 which will still drive the R and B outputs to mid-range intensity, will now drive the G output to full brightness.   



We can see the effect when we click Apply.    The display now appears in a brighter, green color.   Each pixel is no longer gray but now uses shades of green as the proportionately greater value in the Green output over the Red and Blue shifts the displayed color for each pixel from a shade of gray to a shade of green.


If Manifold forced the use of a single channel into all three outputs manipulation like the above would not be possible.  Any change we applied to how the single data channel was used would apply to all three outputs.  We could change contrast in all three outputs simultaneously, for example, but the result would always be a grayscale image with the same numbers driving all three outputs.


See Also



Images and Channels


Palette Images




Style: Autocontrast


Style: Palettes


Style: Formatting Drawings and Labels


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: Change the Contrast of an Image - In this example we use the Edit - Style dialog to change the contrast of an image.


Example: Use the BGR Button to Assign Channels - The BGR button in the Edit - Style dialog for images allows us to assign channels in the data to B, G and R outputs that create the displayed image, using BGR, RGB or Grayscale ordering.


Example: Assign Channels using Source - The Source control in the Style dialog for images assigns channels to display outputs such as R, G, B or A.  .  This topic shows examples of using Source and the visual results.


Example: Set Image Transparency using Alpha - The A row in the Style dialog 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 Edit - Style dialog 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 Edit - Style dialog 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.