Every area scan camera's feature list carries a Gamma entry beside exposure and gain, and it is often left at whatever the factory shipped. Turn it and the image changes in a way brightness and gain cannot imitate: shadows lift or sink while the region near white barely moves, at identical exposure. This guide gives you the mapping curve, worked numbers for gamma 0.5 and gamma 2.0, the rules for YUV, Bayer raw and RGB24 pixel formats, and a five-minute bench test. You will leave knowing what value to set when a person judges the image, what to set when an algorithm reads it, and why an image can change appearance after a camera swap even though nothing in the optics moved.
What does the camera gamma parameter change?
It changes the mapping between the pixel values the sensor produced and the pixel values the camera delivers: the camera applies out = in^γ to each normalized value, redistributing brightness levels across the range while exposure, gain and the sensor itself stay untouched.
The curve is a power law. Black stays black and full scale stays full scale — the two ends are pinned — and everything between them bends. At γ = 0.5, a value of half scale lands on 0.71; at γ = 2.0, the same value lands on 0.25. Gamma therefore moves contrast between the dark half and the bright half of the range without adding light anywhere, which is why it can open up shadow texture that an exposure increase would blow out elsewhere.
The parameter lives in the camera rather than in your capture software, so the hardware this guide describes is an area scan camera — mono or color, GigE or USB3.
Does gamma below 1 brighten or darken the image?
In the convention cameras use, gamma below 1 brightens and gamma above 1 darkens: half of full scale, level 128, rises to about 181 at γ = 0.5 and falls to 64 at γ = 2.0.
The arithmetic is just the rule for a fraction: a number below 1 raised to a power below 1 grows. Half of full scale to the power 0.5 is 0.71; to the power 2 it is 0.25. That is the whole mechanism — one exponent, no offset, no interaction with exposure.
Mind the sign when you cross between tools. Cameras apply out = in^γ. Many image-processing libraries apply the reciprocal exponent, out = in^(1/γ), so a gamma of 2.2 there brightens exactly like a 0.45 in the camera — the same curve described from the display end, as the gamma correction reference sets out. One capture settles which world you are in: send γ = 0.5 to a grey patch and watch whether it brightens or darkens.
What does gamma 0.5 do to a grey patch at each level?
At γ = 0.5 a 16-level shadow pixel rises to 64 and a 240 highlight only reaches 247: dark levels spread out, bright levels crowd together, and the total level count never grows.
| Input (8-bit) | γ = 0.5 out | γ = 1.0 out | γ = 2.0 out |
|---|---|---|---|
| 16 | 64 | 16 | 1 |
| 64 | 128 | 64 | 16 |
| 128 | 181 | 128 | 64 |
| 192 | 221 | 192 | 145 |
| 240 | 247 | 240 | 226 |
Outputs are rounded to the nearest level, which is the ±1 you will see against a live camera.
Work one row by hand. Input 64 at γ = 0.5: 64 / 255 = 0.251; 0.251^0.5 = 0.501; 0.501 × 255 = 128. The same input at γ = 2.0: 0.251^2 = 0.063; 0.063 × 255 = 16. The γ = 2.0 column is the exact mirror of the γ = 0.5 column, because 2.0 = 1/0.5 — one curve undoes the other.
The table also shows the cost. The steps the shadows gain at γ = 0.5 are donated by the bright end: inputs 220 to 240 crowd into outputs 237 to 247. Gamma redistributes levels; it never creates them. Where the levels come from in the first place is a bit-depth question — ADC bit depth versus pixel format covers why a 10-bit sensor can still hand you 8-bit images.
How does gamma treat YUV, Bayer raw and RGB24 formats?
The selected pixel format decides where the curve lands: YUV output takes gamma on the Y luminance channel alone, with U and V untouched, while Bayer raw and RGB24 take the same gamma on every color channel.
Bending all channels equally keeps red, green and blue moving together, which preserves the relationships between them. It is not mathematically exact: a dark red of RGB 100, 20, 20 becomes about RGB 160, 71, 71 at γ = 0.5 — the hue holds, the saturation drops from 0.80 to 0.56. Outputting YUV avoids even that, because the chroma channels never touch the curve.
A mono camera has one channel to bend. A color camera's Bayer raw output takes the same curve on every color channel before demosaicing:
- Sensor format
- 1"
- Lens mount
- C-mount
- Sensor format
- 1"
- Lens mount
- C-mount
Because the effect travels with the format, a gamma tuned while the camera delivered RGB24 can look different once you switch to a raw format for the algorithm. If the format menu refuses to move, why a pixel format will not change explains what fixes the list.
Does gamma change exposure, gain or the sensor data?
No: gamma is an image-processing step applied after digitization, so exposure time, analog gain, the sensor's linear response and the noise floor are all unchanged — only the mapping from captured levels to delivered levels differs.
A sensor is linear underneath: twice the light, twice the value, before any correction. Gamma sits after that point and reshapes the delivered numbers, which is why pixel values versus sensor voltage is pure sensor physics while gamma is bookkeeping on top.
Three habits follow. Keep radiometry, flat-field work and any photometric claim on the γ = 1.0 stream. Do not judge whether the light is sufficient from a gamma-corrected preview — the delivered linear values can still be small. And treat any threshold or model tuned under one gamma as valid only under that gamma.
Why did the image look different after swapping camera models?
Camera families ship different gamma defaults, so a replacement model at the same exposure can deliver visibly brighter shadows than the camera it replaced — compare the gamma settings before you conclude the sensor or the lens has changed.
The comparison takes three captures. Set both cameras to gamma 1.0, hold exposure and gain fixed or pin them to a shared auto exposure brightness target, and image the same grey-step chart. If the linear frames agree, the sensors agree, and whatever remains is the mapping. Re-apply display gamma deliberately on the new camera afterwards.
Then store it where the rest of the camera state lives. Gamma belongs in the same saved configuration as exposure, gain and pixel format — the habits from runtime camera parameter control apply unchanged — not in a slider someone moved once and forgot.
When should gamma sit below 1 and when at 1?
Set gamma 1.0 for any pipeline an algorithm reads and roughly 0.45 to 0.55 for images a person judges on a standard monitor, because the display-friendly band approximates the sRGB encoding, about 1/2.2, that monitors are built around.
For review stations, HMI thumbnails or an operator judging engraving in dark shadows, 0.5 is the workhorse value: dark levels separate, texture in the shadows becomes visible, and the bright end stays calm. For thresholding, gauging from grey levels, barcode contrast and training data, 1.0, without exceptions — otherwise thresholds drift with every camera swap.
Gamma above 1 has a narrower job: it crushes shadows toward black, which cleans up a review image when the feature lives in the bright region and the dark background carries clutter. Work between 1.5 and 2.0 there.
One thing gamma never does is rescue an underexposed frame. A sensor value of 16 pushed to 64 on screen still carries 16 levels of information plus the noise that rode along. Fix dark frames with light and exposure — why a first frame comes out dark walks that diagnosis — and treat gamma as display, never as capture. Gamma is also just one fixed tone curve; when color reproduction must match across cameras too, tone mapping and color consistency is the neighboring problem.
How do you check a camera's gamma on the bench?
Capture a uniform grey target, record the mean value at gamma 1.0, then set gamma 0.5 and check the new mean against the curve — the prediction is 255 × (mean / 255)^0.5, with the exposure readback unmoved.
- Set exposure and light so a uniform grey target averages near mid-grey, roughly 110 to 140, at gamma 1.0.
- Record the mean of a fixed region, say 200 × 200 pixels, and the exposure readback with it.
- Set gamma to 0.5 and record the mean again. The prediction is 255 × (mean / 255)^0.5, so a mean of 100 predicts about 160.
- Re-check the exposure readback. If the mean misses the prediction by more than a level or two of rounding, look for auto exposure or auto gain quietly changing the input rather than the curve.
- Save gamma beside exposure and pixel format in the configuration you ship, so the next camera starts from the same mapping.
GigE, USB3, 10GigE and CoaXPress
1,287 models · from $149.00If you are speccing a camera for a line that mixes operator review with measurement, choose the sensor first in the camera finder and keep the display curve in configuration where the next engineer will find it. More setup guides sit on the cameras topic page, and the applications team answers migration questions through the contact page.
The configurator matches a camera, lens, light, light controller and cables to each other, step by step, and lists only parts that fit what you already picked.
Questions
Is gamma the same as gain?
No. Gain multiplies the sensor signal, and its noise, before digitization, so more gain genuinely captures shadow detail. Gamma only re-maps digitized values after the fact: a gamma-0.5 image looks brighter but contains no detail the sensor did not capture.
Why does a gamma 1.0 image look dark on a monitor?
A monitor applies its own curve of about 2.2 on top of whatever it receives, so linear values render darker than you expect even though they are correct. Keep 1.0 in the measurement path and correct for display at the viewer, or accept a camera default near 0.5 for review stations.
Does gamma change bandwidth, file size or frame rate?
No. Gamma is a value-for-value remap inside the same pixel format and bit depth, so frame size, camera bandwidth and frame rate all stay as they were. Only the code values in each pixel change, which is why it runs at no processing cost inside the camera.
What gamma should a machine-learning pipeline train and run at?
Train and run at the same gamma, and the safest value is 1.0. A model trained on gamma-0.5 images expects that exact mapping at runtime; changing gamma between training and deployment shifts every input distribution and shows up as accuracy loss that looks like a lighting change.
Can gamma recover an underexposed image?
No. Gamma redistributes captured levels, it does not create them: a 16-level shadow driven to 64 on screen still holds 16 distinguishable steps plus whatever noise came with them. Add light, exposure or gain first, then use gamma only on the display copy.

