Using the Grayscale process
The Grayscale process converts a multiband image that is displayed as a color image by defining the red, green, and blue (RGB) bands to a single-band grayscale image. Specified weights can be applied to each of the input bands, or a normalization of the bands can be applied, as shown in the following example:
- Using weights
Output = Band1*Weight1+Band2*Weight2+Band3*Weight3+...
- Using normalization
Output = Output/(Sum of all Weights)
The weights are often applied because some bands have less or more importance than other bands; for example, in Landsat imagery, the blue band often contains more noise than other bands.
The examples below display a true-color orthophotograph generated from a three-band TIFF file (right) and the grayscale image generated from this three-band TIFF (left).
|
|
The input for this process can be one to seven bands, any bit depth, pixel type, or color space. The output is one band, with a grayscale color space, and the same bit depth and pixel type as the input.
Below is a workflow you can use to apply the grayscale process to a three-band TIFF raster dataset. You can easily adapt this to any raster dataset using a three-band combination, such as specifying three bands from a Landsat dataset.
-
Create a new service.
- Create a new service using the defaults (3 bands, unsigned 8-bit integer pixel type, 8 bits), specify the spatial reference system specific to your dataset, then change the color space to grayscale.
-
Add the raster data.
- Click the Image Service drop-down menu on the Image Service Definition Editor toolbar, click Advanced > Add Raster Dataset, then add the TIFF datasets using the TIFF raster type in the Georeferenced Imagery folder.
-
Add the Grayscale process to the service.
-
Open the Image Service Properties dialog box and click Service Processes from the list on the left.
This displays the interface for adding processes to the service.
-
Add the Grayscale process to the selected list and open it using the Edit button
.
You can make changes to the parameters or keep the defaults.
- There is only one option required for this process to display correctly, so you can close the Image Service Properties dialog box.
-
Open the Image Service Properties dialog box and click Service Processes from the list on the left.
- Build the image service definition with the Compute Output Properties options checked, as the output image properties will change to one band from the three-band input.
- Preview the image service.
- Compile the image service definition.
![Tipp Tipp](rsrc/tip.png)
If you have built the service prior to adding the Grayscale process and added the Preview layer to the display, the Preview layer is initialized for display using an RGB color space. You need to rebuild the image service definition with the Compute output pixel properties option checked.