Color Balance Mosaic Dataset (Data Management)
Summary
Color balances a mosaic dataset so the tiles appear seamless.
Usage
-
Color balancing can only take place if the following is true about your data:
- All the bands have their statistics calculated.
- All the bands have their histograms built.
- All the raster datasets have the same number of bands.
- All the raster datasets have the same pixel type and pixel depth. Only 8-bit unsigned and 16-bit unsigned bit depths are supported.
- None of the raster datasets have an associated color map.
-
The Pre-processing Options are performed before any color balancing takes place.
-
There are three balancing algorithms available: Dodging, Histogram, and Standard deviation.
-
The target color surface is only available if the dodging balancing technique is chosen. When using the dodging technique, each pixel needs a target color, which is picked up from the target color surface. There are five types of target color surfaces that you can choose from: single color, color grid, first order surface, second order surface, and third order surface.
-
Target Raster allows you to specify the target to balance your rasters.
- When dodging balancing is used—The target color that will be derived depends on the target color surface type that was chosen. For single color, the average value of the reference target image is used. For color grid, the reference target image is resampled to a suitable grid. For the polynomial order surfaces, the coefficients of the polynomial are obtained by least square fitting, from the reference target image.
- When histogram balancing is used—The target histogram is obtained from the reference target image.
- When standard deviation balancing is used—The target standard deviation is obtained from the reference target image.
To remove a color correction, right-click the mosaic dataset in ArcCatalog or the Catalog window and click Remove > Remove Color Balancing.
Syntax
Parameter | Explanation | Data Type |
in_mosaic_dataset |
Type or browse to the mosaic dataset you want to color balance. | Mosaic Layer |
balancing_method (Optional) |
Choose the balancing algorithm to use.
| String |
color_surface_type (Optional) |
The Target Color Surface Type is only available if the dodging balancing technique is chosen. When using the dodging technique, each pixel needs a target color, which is determined by which surface type is chosen.
| String |
target_raster (Optional) |
The target raster image allows you to specify the target raster to balance your rasters. When dodging balancing is used, the target color that will be derived depends on the target color surface type that was chosen. For Single Color, the average value of the reference target image is used. For Color Grid, the reference target image is resampled to a suitable grid. For the polynomial order surfaces, the coefficients of the polynomial are obtained by the Least Squares Fitting from the reference target image. When Histogram Balancing is used, the target histogram is obtained from the reference target image. When Standard Deviation balancing is used, the target standard deviation is obtained from the reference target image. | Internet Tiled Layer; Map Server Layer; Raster Layer |
exclude_raster (Optional) |
Browse to the raster you want to use as an exclude layer. The Generate Exclude Area tool can be used to create the exclude area. The exclude area is taken into consideration before any color balancing takes place. | Raster Layer |
stretch_type (Optional) |
Prestretching can be performed on each raster catalog item before any other color correction takes place. This means that the original raster catalog item will be using its stretched pixel values, rather than its raw pixel values, in the color correction process. You may want to use this option to change the color to an expected distribution before applying color correction.
| String |
gamma (Optional) |
Type the gamma value to use in the preprocessing stretch. This is only available if the Standard Deviation or Minimum-Maximum prestretch type is chosen. By applying the gamma stretch, you can control the overall brightness of an image. If the gamma coefficient is set too low, the middle tones appear too dark; however, if the gamma coefficient is set too high, the middle tones appear too light. Gamma changes not only the brightness but also the ratios of red to green to blue. | Double |
block_field (Optional) |
The name of the field within a mosaic dataset's attribute table used to identify items that should be considered one item when performing some calculations and operations. | String |
Code Sample
This is a Python sample for ColorBalanceMosaicDataset.
import arcpy
arcpy.ColorBalanceMosaicDataset_management(
"C:/workspace/CC.gdb/cc1", "DODGING", "SINGLE_COLOR",
"C:/workspace/Aerial.lyr", "#", "STANDARD_DEVIATION", "3", "BLOCKNAME")
This is a Python script sample for ColorBalanceMosaicDataset.
#########*#########*##########*#########*#########*#########*#########*&&&&&&&&&&
# Color Correction Mosaic Dataset with target layer
import arcpy
arcpy.env.workspace = "C:/workspace"
mdname = "CC.gdb/cc1"
ccmethod = "DODGING"
dogesurface = "SINGLE_COLOR"
targetras = "C:/workspace/Aerial_photo.lyr"
excluderas = "#"
prestretch = "NONE"
gamma = "#"
blockfield = "#"
arcpy.ColorBalanceMosaicDataset_management(
mdname, ccmethod, dogesurface, targetras, excluderas,
prestretch, gamma, blockfield)