How to Adjust Contrast Selectively for Webcam, Video, and Images

How to Adjust Contrast Selectively for Webcam, Video, and Images (Page Context)

Short answer:
Select the “🍒 Cherry-colored skin” preset for the “Brightness / Contrast lens” effect in the Page context extension.

What you can achieve by changing contrast in a specified place

  1. Real skin color instead of what default camera settings produce.
  2. Highlight the desired celestial bodies in space.
  3. Transmit useful information over the network instead of useless information.

When using a webcam, people often transmit information about a person, but it is transmitted along with information about walls and furniture. The codec takes all this information and compresses it, treating the person and the furniture as equivalent. By changing contrast in the desired place, where there is the maximum amount of information about human skin, you can force the codec to preserve more information about the skin at the expense of unnecessary background information. This happens by increasing the brightness range specifically for the skin and reducing it over the rest of the image. This approach works reliably, unlike the approach where you need to blur something behind the person by cutting out the background, although the goal is the same — to focus specifically on the person. You do not cut off ears with an algorithm; it works in the color dimension, not in the spatial dimension.

How contrast is usually changed

  1. Using contrast.
  2. Using gamma.

What problems ordinary contrast-changing approaches have

  1. Neither of the mentioned methods is aimed at correcting the area you specify. You are forced to break contrast in areas where you do not need to change it in order to change what you do need.
  2. For contrast:
    1. Increasing contrast leads to loss of information in the dark and bright parts.
    2. Decreasing contrast raises or lowers brightness, which essentially means you are narrowing the brightness range, that is, not using the capabilities of your monitor.
    3. You do not control the point on the tone curve with maximum contrast. All points have the same slope on the tone curve, meaning you cannot choose the exact place on the curve you want to focus on.
  3. For gamma:
    1. By changing gamma, you immediately change overall brightness, which requires additional brightness adjustment to compensate.
    2. Instability when crossing 1. On the brightness tone curve, with gamma less than 1, the maximum slope will be at point (0, 0) and the minimum at point (1, 1). If gamma is greater than 1, the maximum slope will be at point (1, 1), and the minimum will be zero at point (0, 0). That is, you have a gamma slider, but when passing through 1, the slider value sharply flips both extreme slope points. The problem with the effect also lies in the fact that, upon reaching 1, the visibility of changes from the effect decreases, so you may not even notice that you have already crossed this point with a sharp flip.
    3. There is no ability to set a value with the maximum contrast effect; the maximum effect appears only at the extreme points (0, 0) and (1, 1) on the tone curve.
    4. By changing contrast, you do not work symmetrically around the area you need on the tone curve. If you want the slope of the curve to be symmetrical around the desired area, it will not work: the slope of the curve either grows or falls across the entire curve, not around the desired area.

Solution via the brightness lens in the Page Context extension

  1. By increasing contrast, you do not lose part of the brightness range.
  2. By decreasing contrast, you do not narrow the brightness range; the range remains, and you only smoothly redistribute contrast along the curve.
  3. You can set the exact position of the point on the tone curve with the desired contrast.
  4. The effect fades as it moves away from the point, acting where you need it.
  5. When moving the point with the maximum contrast change, overall brightness remains stable.
  6. When changing settings, there are no sharp changes in the position of the point with the maximum contrast change.

Core

In the core of the algorithm, you set the main goals for the contrast lens effect.

Algorithm goals:

  1. Relative brightness level.
  2. Position of the contrast gain point (focus point).
  3. Contrast gain for the focus point.

Each algorithm goal can be changed independently — this makes it possible to change settings without spoiling the other goals.

Focus gain (dB)

Sets contrast as the slope of the tone curve at the desired point in decibels. Here you can decide how much you need to change the contrast.

Brightness level

The relative brightness level. Here you can decide how much brighter it should be. You cannot change brightness arbitrarily while preserving the contrast goal, because this requires changing the tone curve, and its curvature is limited by the contrast goal. However, you can set the relative position between the possible boundaries of the brightness level. This is exactly where this relative brightness position is set.

Focus shift

Shift of the output brightness of the focus point. The shift is made relative to the gray value of the output brightness. Here you can decide in which place of the tone curve the effect should act more strongly. With this parameter, you can control the “lens position,” meaning you can change the position of the lens’s maximum influence on the tone curve. In practice, we need to strengthen a specific area while weakening the rest; here we can choose the place for this contrast-gain area.

Linearity blend

Linear blending allows a smooth transition from a power function to a linear one away from the contrast-change area. This helps choose the best of both approaches.

Approaches:

  1. Power approach. A power function has pros and cons. It helps set the desired slope at the specified point and smoothly transition to the edges, but the smooth transition to the edges creates an extreme slope at the edges, so at the extreme points, far from the desired point, you can use a linear approach with a slope that is better suited.
  2. Linear approach. A linear function cannot produce a smooth tone curve at the point where the slope is set, but at the edges far from this point it often gives a more suitable slope.

At the point that sets the contrast strength, only the power component always works, meaning the linear component there is always zero under any settings.

Strength

The weight of the linear component at the edges of the tone curve.

If the contrast gain is positive, sometimes it may seem that some dark details are too dark, so by increasing the strength of linear blending, you can smoothly bring back unnoticeable details. Bringing back details will affect both the dark and light parts.

At a value of 0, only the power component of the tone curve will work.

It sets both directions, light and dark, with one parameter; otherwise, the transition from the light to the dark part would become less smooth on the tone curve.

Example

Conditions: you increased contrast by setting Focus gain, and Strength is 0.

Problem: you see that the dark details have become so dark that they are difficult to make out.

Solution: gradually increase Strength until the details become sufficiently distinguishable again.

Bright focus exponent

The exponent in the power function of the blending weights. The larger the value, the more the light part of the tone curve resembles linear behavior.

Dark focus exponent

The exponent in the power function of the blending weights. The larger the value, the more the dark part of the tone curve resembles linear behavior.


Author:
Anton Voronov
Published:
11/14/2026
Updated:
11/14/2026

Related questions