Summary
Makes transitions from one image to an adjoining image 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 histogram built.
- Only 8-bit unsigned and 16-bit unsigned bit depths are supported.
- None of the raster dataset have an associated color map.
The bands in the Target Raster need to be in the same order as the bands in the input mosaic dataset. Ideally, the number of bands should be the same. If there are more bands in the input mosaic dataset, the bands in the target raster will be used again, sequentially.
If the bit depth of the input mosaic dataset and the target raster are different, the pixel values will be automatically scaled so that they are both in the same bit depth.
The actions defined by the Exclude Area Raster, Stretch Type, and Gamma parameters (exclude_raster, stretch_type, and gamma in Python) are performed before any color balancing takes place. On the tool's dialog box, these three parameters are found in the Preprocessing Options parameter category.
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.
The Target Raster is a raster that is used to guide color balancing.
- 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 the Catalog pane and click Remove > Remove Color Balancing
Syntax
ColorBalanceMosaicDataset(in_mosaic_dataset, {balancing_method}, {color_surface_type}, {target_raster}, {exclude_raster}, {stretch_type}, {gamma}, {block_field})
Parameter | Explanation | Data Type |
in_mosaic_dataset | The mosaic dataset you want to color balance. | Mosaic Layer |
balancing_method (Optional) | The balancing algorithm to use.
| String |
color_surface_type (Optional) | When using the Dodging balance method, each pixel needs a target color, which is determined by the surface type.
| String |
target_raster (Optional) | The raster you want to use to color balance the other images. The balance method and color surface type, if applicable, will be derived from this image. | Raster Dataset; Raster Layer; Internet Tiled Layer; Map Server Layer |
exclude_raster (Optional) | Apply a mask before color balancing the mosaic dataset. Create the mask using the Generate Exclude Area tool. | Raster Layer |
stretch_type (Optional) | Stretch the range of values before color balancing. Choose from one of the following options:
| String |
gamma (Optional) | Adjust the overall brightness of an image. A low value will minimize the contrast between moderate values by making them appear darker. Higher values increase the contrast by making them appear brighter. | Double |
block_field (Optional) | The name of the field in a mosaic dataset's attribute table used to identify items that should be considered one item when performing some calculations and operations. | String |
Derived Output
Name | Explanation | Data Type |
out_mosaic_dataset | The updated mosaic dataset. | Mosaic Layer |
Code sample
This is a Python sample for the ColorBalanceMosaicDataset tool.
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 the ColorBalanceMosaicDataset tool.
#########*#########*##########*#########*#########*#########*#########*&&&&&&&&&&
# 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)
Environments
Licensing information
- Basic: No
- Standard: Yes
- Advanced: Yes