Skip to content

Black Level#

The Black Level camera feature allows you to change the overall brightness of an image. All gray values of the pixels are changed by a specified amount.

For example, you can increase the gray value of each pixel in the image by 3.

Using the Feature#

Adjusting the Black Level#

To adjust the black level, enter a value for the BlackLevel parameter.

The change in the gray value resulting from the BlackLevel parameter value depends on the camera model.

Info

Basler recommends setting the black level to 0 before using any of the color enhancement features, e.g., Balance White, Color Transformation, or Gamma. After the color enhancements have been applied, you can change the black level as desired. However, increasing the black level will decrease the color accuracy.

Black Level Compensation#

Dark current can have a negative impact on image quality. Some imaging sensors can compensate for this by automatically adjusting the black level.

On some camera models, you can manually enable or disable this automatic adjustment using the BslBlackLevelCompensationMode parameter.

To do so, set the BslBlackLevelCompensationMode parameter to one of the following values:

  • Sensor: Black level compensation is performed by the imaging sensor. The sensor tries to compensate for thermally generated voltages that would affect the signals (dark current).
  • Off: Black level compensation is disabled. This is useful, e.g., for quantitative analysis of weak light signals or if you need raw image data without dark current correction.
    Setting the compensation mode to Off resets all internal correction values used for black level compensation.

Specifics#

Show all camera models

Camera Model BslBlackLevelCompensationMode Parameter Available Change in BlackLevel Parameter Value Resulting Change in Gray Value
a2A1920-51gcBAS No ± 1 ± 1
a2A1920-51gcPRO No ± 1 ± 1
a2A1920-51gmBAS No ± 1 ± 1
a2A1920-51gmPRO No ± 1 ± 1
a2A1920-160ucBAS No ± 1 ± 1
a2A1920-160ucPRO No ± 1 ± 1
a2A1920-160umBAS No ± 1 ± 1
a2A1920-160umPRO No ± 1 ± 1
a2A2590-22gcBAS No ± 1 ± 0.0625
a2A2590-22gcPRO No ± 1 ± 0.0625
a2A2590-22gmBAS No ± 1 ± 0.0625
a2A2590-22gmPRO No ± 1 ± 0.0625
a2A2590-60ucBAS No ± 1 ± 0.0625
a2A2590-60ucPRO No ± 1 ± 0.0625
a2A2590-60umBAS No ± 1 ± 0.0625
a2A2590-60umPRO No ± 1 ± 0.0625
a2A3840-13gcBAS No ± 1 ± 0.0625
a2A3840-13gcPRO No ± 1 ± 0.0625
a2A3840-13gmBAS No ± 1 ± 0.0625
a2A3840-13gmPRO No ± 1 ± 0.0625
a2A3840-45ucBAS No ± 1 ± 0.0625
a2A3840-45ucPRO No ± 1 ± 0.0625
a2A3840-45umBAS No ± 1 ± 0.0625
a2A3840-45umPRO No ± 1 ± 0.0625
a2A4504-5gcBAS No ± 1 ± 1
a2A4504-5gcPRO No ± 1 ± 1
a2A4504-5gmBAS No ± 1 ± 1
a2A4504-5gmPRO No ± 1 ± 1
a2A4504-18ucBAS No ± 1 ± 1
a2A4504-18ucPRO No ± 1 ± 1
a2A4504-18umBAS No ± 1 ± 1
a2A4504-18umPRO No ± 1 ± 1
a2A5320-7gcBAS No ± 1 ± 1
a2A5320-7gcPRO No ± 1 ± 1
a2A5320-7gmBAS No ± 1 ± 1
a2A5320-7gmPRO No ± 1 ± 1
a2A5320-23ucBAS No ± 1 ± 1
a2A5320-23ucPRO No ± 1 ± 1
a2A5320-23umBAS No ± 1 ± 1
a2A5320-23umPRO No ± 1 ± 1
a2A5328-4gcBAS No ± 1 ± 1
a2A5328-4gcPRO No ± 1 ± 1
a2A5328-4gmBAS No ± 1 ± 1
a2A5328-4gmPRO No ± 1 ± 1
a2A5328-15ucBAS No ± 1 ± 1
a2A5328-15ucPRO No ± 1 ± 1
a2A5328-15umBAS No ± 1 ± 1
a2A5328-15umPRO No ± 1 ± 1
acA640-90gc No 8-bit pixel formats: ± 64
12-bit pixel formats: ± 4
± 1
acA640-90gm No 8-bit pixel formats: ± 64
12-bit pixel formats: ± 4
± 1
acA640-90uc No ± 1 ± 1
acA640-90um No ± 1 ± 1
acA640-120gc No 8-bit pixel formats: ± 64
12-bit pixel formats: ± 4
± 1
acA640-120gm No 8-bit pixel formats: ± 64
12-bit pixel formats: ± 4
± 1
acA640-120uc No ± 1 ± 1
acA640-120um No ± 1 ± 1
acA640-121gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA640-300gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA640-300gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA640-750uc No ± 1 ± 1
acA640-750um No ± 1 ± 1
acA720-290gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA720-290gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA720-520uc No ± 1 ± 1
acA720-520um No ± 1 ± 1
acA780-75gc No 8-bit pixel formats: ± 64
12-bit pixel formats: ± 4
± 1
acA780-75gm No 8-bit pixel formats: ± 64
12-bit pixel formats: ± 4
± 1
acA800-200gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA800-200gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA800-510uc No ± 1 ± 1
acA800-510um No ± 1 ± 1
acA1280-60gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1280-60gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1300-22gc No 8-bit pixel formats: ± 64
12-bit pixel formats: ± 4
± 1
acA1300-22gm No 8-bit pixel formats: ± 64
12-bit pixel formats: ± 4
± 1
acA1300-30gc No 8-bit pixel formats: ± 64
12-bit pixel formats: ± 4
± 1
acA1300-30gm No 8-bit pixel formats: ± 64
12-bit pixel formats: ± 4
± 1
acA1300-30uc No ± 1 ± 1
acA1300-30um No ± 1 ± 1
acA1300-60gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1300-60gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1300-60gmNIR No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1300-75gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1300-75gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1300-200uc No ± 1 ± 1
acA1300-200um No ± 1 ± 1
acA1440-73gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA1440-73gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA1440-220uc No ± 1 ± 1
acA1440-220um No ± 1 ± 1
acA1600-20gc No 8-bit pixel formats: ± 64
12-bit pixel formats: ± 4
± 1
acA1600-20gm No 8-bit pixel formats: ± 64
12-bit pixel formats: ± 4
± 1
acA1600-20uc No ± 1 ± 1
acA1600-20um No ± 1 ± 1
acA1600-60gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1600-60gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1920-25gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA1920-25gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA1920-25uc No ± 1 ± 1
acA1920-25um No ± 1 ± 1
acA1920-40gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA1920-40gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA1920-40uc No ± 1 ± 1
acA1920-40ucMED No ± 1 ± 1
acA1920-40um No ± 1 ± 1
acA1920-40umMED No ± 1 ± 1
acA1920-48gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1920-48gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA1920-50gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA1920-50gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA1920-150uc No ± 1 ± 1
acA1920-150um No ± 1 ± 1
acA1920-155uc No ± 1 ± 1
acA1920-155ucMED No ± 1 ± 1
acA1920-155um No ± 1 ± 1
acA1920-155umMED No ± 1 ± 1
acA2000-50gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2000-50gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2000-50gmNIR No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2000-165uc No ± 1 ± 1
acA2000-165um No ± 1 ± 1
acA2000-165umNIR No ± 1 ± 1
acA2040-25gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2040-25gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2040-25gmNIR No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2040-35gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2040-35gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2040-55uc No ± 1 ± 1
acA2040-55um No ± 1 ± 1
acA2040-90uc No ± 1 ± 1
acA2040-90um No ± 1 ± 1
acA2040-90umNIR No ± 1 ± 1
acA2040-120uc No ± 1 ± 1
acA2040-120um No ± 1 ± 1
acA2440-20gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2440-20gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2440-35uc No ± 1 ± 1
acA2440-35ucMED No ± 1 ± 1
acA2440-35um No ± 1 ± 1
acA2440-35umMED No ± 1 ± 1
acA2440-75uc No ± 1 ± 1
acA2440-75ucMED No ± 1 ± 1
acA2440-75um No ± 1 ± 1
acA2440-75umMED No ± 1 ± 1
acA2500-14gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2500-14gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA2500-14uc No ± 1 ± 1
acA2500-14um No ± 1 ± 1
acA2500-20gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA2500-20gcMED No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA2500-20gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA2500-20gmMED No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA2500-60uc No ± 1 ± 1
acA2500-60um No ± 1 ± 1
acA3088-16gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± approx. 1
± 1
acA3088-16gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± approx. 1
± 1
acA3088-57uc No ± 1 ± approx. 1
acA3088-57ucMED Yes ± 1 ± approx. 1
acA3088-57um No ± 1 ± approx. 1
acA3088-57umMED Yes ± 1 ± approx. 1
acA3800-10gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA3800-10gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA3800-14uc No ± 1 ± 1
acA3800-14um No ± 1 ± 1
acA4024-8gc No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA4024-8gm No 8-bit pixel formats: ± 4
10-bit pixel formats: ± 1
12-bit pixel formats: ± 1
± 1
acA4024-29uc No ± 1 ± approx. 1
acA4024-29um No ± 1 ± approx. 1
acA4096-11gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA4096-11gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA4096-30uc No ± 1 ± 1
acA4096-30ucMED No ± 1 ± 1
acA4096-30um No ± 1 ± 1
acA4096-30umMED No ± 1 ± 1
acA4096-40uc No ± 1 ± 1
acA4096-40ucMED No ± 1 ± 1
acA4096-40um No ± 1 ± 1
acA4096-40umMED No ± 1 ± 1
acA4112-8gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA4112-8gm No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA4112-20uc No ± 1 ± 1
acA4112-20ucMED No ± 1 ± 1
acA4112-20um No ± 1 ± 1
acA4112-20umMED No ± 1 ± 1
acA4112-30uc No ± 1 ± 1
acA4112-30ucMED No ± 1 ± 1
acA4112-30um No ± 1 ± 1
acA4112-30umMED No ± 1 ± 1
acA4600-7gc No 8-bit pixel formats: ± 16
12-bit pixel formats: ± 1
± 1
acA4600-10uc No ± 1 ± 1
acA5472-5gc No ± 1 8-bit pixel formats: ± 1
12-bit pixel formats: ± 4
acA5472-5gm No ± 1 8-bit pixel formats: ± 1
12-bit pixel formats: ± 4
acA5472-17uc No ± 1 8-bit pixel formats: ± 1
12-bit pixel formats: ± 4
acA5472-17ucMED No ± 1 8-bit pixel formats: ± 1
12-bit pixel formats: ± 4
acA5472-17um No ± 1 8-bit pixel formats: ± 1
12-bit pixel formats: ± 4
acA5472-17umMED No ± 1 8-bit pixel formats: ± 1
12-bit pixel formats: ± 4
boA4096-93cc No ± 1 ± 1
boA4096-93cm No ± 1 ± 1
boA4112-68cc No ± 1 ± 1
boA4112-68cm No ± 1 ± 1
boA4500-45cc No 8-bit pixel formats: ± 16
10-bit pixel formats: ± 4
12-bit pixel formats: ± 1
± 1
boA4500-45cm Yes 8-bit pixel formats: ± 16
10-bit pixel formats: ± 4
12-bit pixel formats: ± 1
± 1
boA6500-36cc No 8-bit pixel formats: ± 16
10-bit pixel formats: ± 4
12-bit pixel formats: ± 1
± 1
boA6500-36cm Yes 8-bit pixel formats: ± 16
10-bit pixel formats: ± 4
12-bit pixel formats: ± 1
± 1
boA8100-16cc No 8-bit pixel formats: ± 16
10-bit pixel formats: ± 4
12-bit pixel formats: ± 1
± 1
boA8100-16cm Yes 8-bit pixel formats: ± 16
10-bit pixel formats: ± 4
12-bit pixel formats: ± 1
± 1
daA1280-54lc No ± 1a ± 1
daA1280-54lm No ± 1a ± 1
daA1280-54uc No ± 1a ± 1
daA1280-54um No ± 1a ± 1
daA1600-60lc No ± 1a ± 1
daA1600-60lm No ± 1a ± 1
daA1600-60uc No ± 1a ± 1
daA1600-60um No ± 1a ± 1
daA1920-15um No ± 1a ± 1
daA1920-30uc No ± 1a ± 1
daA1920-30um No ± 1a ± 1
daA1920-160uc No ± 1 ± 1
daA1920-160um No ± 1 ± 1
daA2500-14lc No ± 1a ± 1
daA2500-14lm No ± 1a ± 1
daA2500-14uc No ± 1a ± 1
daA2500-14um No ± 1a ± 1
daA3840-45uc No ± 1 ± 0.0625
daA3840-45um No ± 1 ± 0.0625
puA1280-54uc No ± 1a ± 1
puA1280-54um No ± 1a ± 1
puA1600-60uc No ± 1a ± 1
puA1600-60um No ± 1a ± 1
puA1920-30uc No ± 1a ± 1
puA1920-30um No ± 1a ± 1
puA2500-14uc No ± 1a ± 1
puA2500-14um No ± 1a ± 1

  1. On daA1280-54um/uc, daA1280-54lm/uc, and puA1280-54um/uc cameras, the black level settings are applied to the pixel data after the gain settings. On all other dart and pulse cameras, the black level settings are applied before the gain settings.

Sample Code#

ace Classic/U/L GigE Cameras#

// Set the black level to 32
camera.BlackLevelRaw.SetValue(32);
// Disable black level compensation
// Note: Available on selected camera models only
camera.BslBlackLevelCompensationMode.SetValue(BslBlackLevelCompensationMode_Off);
INodeMap& nodemap = camera.GetNodeMap();
// Set the black level to 32
CIntegerParameter(nodemap, "BlackLevelRaw").SetValue(32);
// Disable black level compensation
// Note: Available on selected camera models only
CEnumParameter(nodemap, "BslBlackLevelCompensationMode").SetValue("Off");
// Set the black level to 32
camera.Parameters[PLCamera.BlackLevelRaw].SetValue(32);
// Disable black level compensation
// Note: Available on selected camera models only
camera.Parameters[PLCamera.BslBlackLevelCompensationMode].SetValue(PLCamera.BslBlackLevelCompensationMode.Off);
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK;  /* Return value of pylon methods */
/* Set the black level to 32 */
errRes = PylonDeviceSetIntegerFeature(hdev, "BlackLevelRaw", 32);
CHECK(errRes);
/* Disable black level compensation */
/* Note: Available on selected camera models only */
errRes = PylonDeviceFeatureFromString(hdev, "BslBlackLevelCompensationMode", "Off");
CHECK(errRes);

Other Cameras#

// Set the black level to 32
camera.BlackLevel.SetValue(32);
// Disable black level compensation
// Note: Available on selected camera models only
camera.BslBlackLevelCompensationMode.SetValue(BslBlackLevelCompensationMode_Off);
INodeMap& nodemap = camera.GetNodeMap();
// Set the black level to 32
CIntegerParameter(nodemap, "BlackLevel").SetValue(32);
// Disable black level compensation
// Note: Available on selected camera models only
CEnumParameter(nodemap, "BslBlackLevelCompensationMode").SetValue("Off");
// Set the black level to 32
camera.Parameters[PLCamera.BlackLevel].SetValue(32);
// Disable black level compensation
// Note: Available on selected camera models only
camera.Parameters[PLCamera.BslBlackLevelCompensationMode].SetValue(PLCamera.BslBlackLevelCompensationMode.Off);
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK;  /* Return value of pylon methods */
/* Set the black level to 32 */
errRes = PylonDeviceSetIntegerFeature(hdev, "BlackLevel", 32);
CHECK(errRes);
/* Disable black level compensation */
/* Note: Available on selected camera models only */
errRes = PylonDeviceFeatureFromString(hdev, "BslBlackLevelCompensationMode", "Off");
CHECK(errRes);

You can also use the pylon Viewer to easily set the parameters.