Example: Display an NAIP Four Band Image as Color Infrared (CIR)

This topic illustrates how to create Color Infrared CIR images using NAIP four band imagery.  In this example, we take a four band NAIP image that shows part of Redding, California, and we create a CIR display by re-assigning data channels to color outputs.   We use the Style pane to dynamically alter how channels are used for display purposes, without actually rearranging the order of channels within the image.


See the companion topics, Example: Shuffle Channels with a Raster Self Join and Example: Rearrange Channels using an Expression, to learn how to rearrange channels in a permanent way, and not just for display purposes.

Four Channel NAIP Images

The National Agriculture Imagery Program (NAIP) run by the US Department of Agriculture (USDA) acquires aerial imagery with a resolution of approximately one meter during the agricultural growing seasons in the continental United States. Although historically acquired as RGB imagery in visible spectra, beginning in 2007, various states began acquiring NAIP imagery as four band imagery, with Red, Green Blue and near-Infrared bands.   Starting in 2018 NAIP imagery was acquired with a resolution of 60 cm.  


Nomenclature:  Band and Channel are used as synonyms.  The USDA tends to uses band, while modern technical applications tend to use channel, but both are perfectly good words that in this context mean the same thing.  Manifold uses channel.   USDA numbers channels counting 1, 2, 3, 4.  Manifold uses the more technical approach (so the numbers stay the same when using SQL, writing scripts, using functions, etc.) of counting channels as 0, 1, 2, 3.   This documentation uses 0, 1, 2, 3.


Four band NAIP imagery uses the following channel order:



NAIP imagery is thus the classic RGB channel ordering (plus an extra channel) used in most natural color images, which usually are referred to as "RGB" images.   


A popular use of four band NAIP imagery is to create false color images that use the near-Infrared channel 3 for Red and which does not use the blue band.   Various combinations are possible, but the traditional combination used for what are called Color Infrared (CIR ) images uses these assignments:



The above arrangement uses Infrared wavelengths to drive the Red output, Red wavelengths to drive the Green output, and Green wavelengths to drive the Blue output.  The channel that records Blue wavelengths is not used.     

Re-Assign Channels

Changing channel assignments to those traditionally used for CIR is a matter of just a few clicks in the Style pane for images.   We download a four band NAIP from the US Government's free earthexplorer.usgs.gov web site.   The image we choose shows the Eastern parts of Redding, California, and is an approximately 450 MB file in .tif format.  It is 9410 x 12140 pixels in size, a tiny image for Manifold.



We import the image into Manifold and double-click it in the Project pane to open it, as seen above.  We launch the Style pane.



Our task now is to assign channels using the traditional CIR arrangement:




We do that by double-clicking into each channel cell in turn and choosing the channel we want to assign to that color output.



We begin by double-clicking into the channel cell for the R output and choosing Channel 3.  


 When the row cursor is already on a cell, we can open that cell for editing by simply clicking it.   If the cursor is not on a cell, we can open the cell for editing by double-clicking it.  



Next, we double-click into the channel cell for the G output and choose Channel 2.  



Finally, we double-click into the channel cell for the B output and choose Channel 1.  



That is the traditional CIR channel assignment we want.  We press Update Style to apply the changes.



Immediately, the image takes on the classic appearance of CIR images.  We can zoom in to get a more detailed look at areas with foliage.



Zoomed into a region to the left, middle of the bigger image, showing land just above the Sacramento River, we see a more classic, reddish, otherworldly CIR image.   The dark pixels at the bottom of the image are from the Sacramento River, the water of which radiates weakly in near-Infrared wavelengths in this scene.



For comparison, we can restore the natural color, RGB arrangement of channels with a single click on the dropdown menu for the Assign Channels button.


Why the traditional CIR arrangement?   It results in an image that matches the reddish, false color look of photographic images obtained using Kodak color Infrared film. Kodak's CIR film was developed during WWII to record near Infrared, red, and green channels instead of the usual red, green and blue channels.  During the war, Kodak's film was used to distinguish camouflage from real plant cover, since in near Infrared camouflage has a different appearance than real foliage.


In modern times, digital sensors acquire red, green, blue, and near-Infrared bands to record a four band image.  When the bands are combined in a GIS package to use red, green and blue bands the result is a natural color RGB aerial photo.  When bands are combined to use near-Infrared, red and green, the result is a CIR image.   CIR imagery is used to monitor the health of crops or forests and to distinguish plant species. Near-Infrared also penetrates atmospheric haze better than visible light bands, so CIR images can be sharper than natural color RGB images.


Changing channel assignments vs changing channel order - Different image formats utilize different arrangements of channels within the actual image data.  Some have the red channel first, while other arrangements have the blue channel first.  No matter what channel ordering is used within the data, Manifold's Style pane allows us to specify how those channels should be assigned to red, green and blue display outputs.


Using the Style pane to say how data channels should be used does not  change the order of data channels within the actual image.   It simply reassigns how the data should be interpreted for display purposes.   If we want to change the actual order of data in the image, we should use the technique illustrated in the Example: Rearrange Channels using an Expression topic or in the Example: Shuffle Channels with a Raster Self Join topic.



Create USGS File Names with Transform


Finding NAIP Imagery with Viewer


5 Minute Tutorial - Previews



See Also



Images and Channels


Palette Images




Style: Images


Style: Channels and Outputs Tutorial


Style: Autocontrast


Style: Palettes


Example: Create USGS File Names with Transform - NAIP images cover almost all of the United States with aerial photography in 4 bands at 1 meter or 0.6 meter resolution.  We would like to download NAIP images for our areas of interest via direct download from the USGS archives on Amazon AWS.  We can create our own indices for NAIP imagery by using the Transform pane to extract and transform the data we want from generic USGS indices for quads and quarter-quads.


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 pane to change the contrast of an image.


Example: Using the Assign Channels Button - The Assign Channels button in the Style pane 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 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: Shuffle Channels with a Raster Self Join - We use the Join dialog to rearrange channels within an image,   Starting with a four channel image that has RGB plus infrared channels, we rearrange the order of channels so that infrared values are in the first channel powering the red output, red values are in the second channel powering the green output, and green values are in the third channel the blue output.   This is the classic Color Infrared (CIR) channel arrangement.  Unlike a virtual rearrangement using Style shown in the Example: Display an NAIP Four Band Image as Color Infrared (CIR) topic, rearranging channels in this way changes the structure of the data so that any exported image will retain the new arrangement.


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.


Example: Autocontrast and Hill Shading Images using Style - This example shows how the Style pane 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 pane 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.


SQL Example: Create NDVI Displays - How to create a query that creates an NDVI display from a four-band NAIP image, with tips and tricks on how to copy and paste existing information to get the result we want.


Example: Rearrange Channels using an Expression - We use a simple expression in the Transform pane to rearrange the order of channels within the data.