Home  /  Guides  /  What one gamma number does to a folder

One Gamma Number, Seven Settings, The Same 68%

Updated 2026-11-25 · measured on 12 mixed files, 20,933,726 bytes, 63,016,384 pixels, seven gamma settings from 0.5 to 3.0

The short answer

Gamma 1.0 changed zero pixels on all 11 readable files. The other six settings each changed about 68.2% of the batch — 42,970,116 to 42,995,243 of 63,016,384 — because pure black and pure white are fixed points of the curve and sit on roughly two thirds of these frames.

What actually differs between 0.8 and 3.0 is how hard the midtones move. Mean absolute change on the landscape photo went 8.213 at gamma 0.8 to 34.609 at gamma 3.0, while the count of changed pixels barely moved. At gamma 2.2 the 256 input levels collapsed to 184 distinct output values; at 3.0 they collapsed to 158.

This page measures gamma as a batch operation: what a folder of mixed files looks like after one number is applied to all of them. For the operations that run on the same twelve files, see the batch equalize measurement (level distribution instead of a fixed curve), the batch edge measurement, the batch sharpen measurement, the batch grayscale measurement and the batch invert measurement. For a shifted rather than curved brightness change, the batch blur measurement covers radius families. To flip a photo instead, start at the photo flipper.

Gamma and equalize are easy to confuse because both change brightness on a whole folder. They are different operations: equalize rebuilds the histogram so ranks of pixel values are preserved, while a fixed curve moves every value the same way. On this batch equalize changed 7,921,068 pixels of the landscape photo where gamma 2.2 changed 7,922,051, yet the two outputs differed from each other on 7,921,613 pixels, 66.013% of the frame. The same pixels move; they do not land in the same place.

1. What was run and on what

Twelve files, 20,933,726 bytes on disk and 63,016,384 pixels across the 11 that decoded. Each readable file was converted to RGBA, each of its three colour channels was passed through the same 256-entry lookup table, and the result was written as an 8-bit PNG and compared with the decoded input pixel by pixel. The curve is the conventional power law: output equals 255 times (input divided by 255) raised to the power 1/gamma, rounded to the nearest integer.

What the twelve files were: two byte-identical 3000 x 4000 portrait JPEGs, one 4000 x 3000 landscape JPEG, one 3000 x 4000 grayscale JPEG, one 2000 x 1500 JPEG with an orientation tag, one 3000 x 3000 PNG, one 1200 x 800 transparent PNG, one 128 x 128 PNG icon, one 1600 x 900 WebP, one 400 x 300 six-frame GIF, one 800 x 600 16-bit grayscale PNG, and one truncated 1,200-byte JPEG that failed to decode. Nothing left the machine. Pillow 13.0.0, numpy 2.5.4 and Python 3.13.14.

2. The percentage is flat, the strength is not

Every setting except 1.0 changed close to the same number of pixels. That looks like the control does nothing, and it is the opposite: the count of changed pixels is a near-duplicate of the count of non-black, non-white pixels, which is a property of the photo rather than of the setting. The setting shows up in the magnitude.

GammaPixels changedShare of batchMean abs change, landscape
0.542,995,24368.229%25.394
0.842,978,92168.203%8.213
1.000.0%0.0
1.242,970,11668.189%6.552
1.842,992,40768.224%20.161
2.242,995,24368.229%26.222
3.042,995,24368.229%34.609

Mean abs change is the average absolute difference across all three colour channels of photo_landscape.jpg on a 0 to 255 scale. The batch share of 68.229% at gamma 3.0 equals 42,995,243 divided by 63,016,384.

Mean abs change, photo_landscape.jpg gamma 0.8 8.213 gamma 1.2 6.552 gamma 1.8 20.161 gamma 0.5 25.394 gamma 2.2 26.222 gamma 3.0 34.609
Average absolute channel change on the landscape photo at six of the seven settings. Gamma 1.0 is off the chart at 0.0. Scale is linear to 36.
Your call: 0.8 and 3.0 change almost exactly the same number of pixels, so a pixel-count audit will not tell you which one ran. Judge these by how far the midtones moved and by the level collapse in section 4, not by the percentage in the table above.

3. Black and white never move

This is the property that separates gamma from brightness. The curve maps 0 to 0 and 255 to 255 by construction, so the darkest and lightest values in a folder are untouched no matter which number is used. On the landscape photo at gamma 2.2, 22,452,413 of the 36,000,000 channel values went up, none went down, the largest single move was 72, and the pixels at 255 as well as the pixels at 0 stayed put — a contrast with brightness, which moves the pixels at 0 too.

Input levelgamma 0.5gamma 0.8gamma 1.2gamma 2.2gamma 3.0
000000
16182572101
64164581136161
12864108144186203
176121160187215225
240226236242248250
255255255255255255

The bottom row is the important one for a dark photo. Level 16 moves 85 steps at gamma 3.0, while level 240 moves 10. A folder of underexposed night shots will visibly change; a folder of bright product shots on white will barely move, and that is measurable before you run it: count the pixels at 255 first.

Where level 16 and level 240 land input 0 0 / 0 / 0 input 16 1 / 8 / 72 input 128 64 / 108 / 186 input 240 226 / 236 / 248 gamma 0.5 gamma 0.8 gamma 2.2 Bar width is the output level, linear to 255.
The same four inputs at three settings. The dark end is where gamma earns its keep; the bright end barely moves and cannot be recovered once clipped.

4. Levels collapse, and more at higher gamma

A lookup table can only produce 256 outputs, so a steep curve must skip some of them. At gamma 2.2 the outputs covered 184 distinct values out of 256, meaning 72 values could never appear in any file no matter what it contains. The count rises with the strength of the curve, and it rises in both directions even though one brightens and one darkens.

GammaDistinct output levelsValues never producedSlope 0–85Slope 85–170Slope 170–255
0.5192640.3291.01.671
0.8235210.7651.0471.188
1.025601.01.01.0
1.2239171.20.9410.859
1.8235541.6350.7650.6
2.2184721.8240.6710.506
3.0158982.0820.5410.376

Slope is output change per one step of input, taken across the whole band: the value at the top of the band minus the value at the bottom, divided by the band width. A slope of 0.506 means eight consecutive input levels land on roughly four output levels.

The practical consequence is banding in smooth gradients, not extra grain. A photo that arrived with 5 distinct levels still has 5 after the curve, because a lookup table cannot create values that were not in the input; it can only merge them. Files that already carry 256 levels are where the loss appears, and it shows as a stepped sky rather than as noise.

5. The same setting moves wildly different shares of each file

A percentage of changed pixels is a property of the file, not of the setting. At gamma 2.2 the same curve changed 87.532% of the square PNG and 0.388% of the 16-bit grayscale file. What separates them is how much of each frame sits at exactly 0 or exactly 255.

FilePixelsChanged at gamma 2.2Mean abs changeLevels afterEqualize changedLevels after equalize
photo_square.png9,000,0007,877,898 (87.532%)34.757184
small_icon.png16,38411,249 (68.658%)28.83618411,249175
screenshot.webp1,440,000961,351 (66.76%)27.092184——
exif_orient6.jpg3,000,0001,987,527 (66.251%)26.632184——
photo_landscape.jpg12,000,0007,922,051 (66.017%)26.2221847,921,068170
photo_portrait.jpg12,000,0007,913,234 (65.944%)26.2151847,912,336170
duplicate_photo.jpg12,000,0007,913,234 (65.944%)26.2151847,912,336170
gray_8bit.jpg12,000,0007,883,619 (65.697%)32.821184——
logo_alpha.png960,000513,220 (53.46%)20.0625513,2203
animation.gif120,00010,000 (8.333%)2.3332——
gray_16bit.png480,0001,860 (0.388%)0.186184——
broken.jpgtruncated, failed to decode; no output written

Levels after counts distinct values in the output image, all three channels together, so a file that never used many levels cannot show the collapse. Every file moved almost exactly the same pixels under equalize and under gamma 2.2, while the two outputs differ from each other on 66.013% of the landscape frame. A dash means equalize was not run on that file in this pass; the two byte-identical portrait JPEGs produced identical rows.

Your call: which of these files actually needs the lift is your judgement, and the percentage will not tell you. A file at 0.388% is not "already correct", it is one whose values sit where the curve has nothing to do; whether it looks right is something you have to look at.
Share changed at gamma 2.2 photo_square 87.532% photo_landscape 66.017% logo_alpha 53.46% animation.gif 8.333% gray_16bit 0.388% Bar width is linear to 100 percent. All five rows use gamma 2.2.
Five files from the batch at one fixed setting. The 16-bit grayscale file is almost entirely at 65535 before conversion, which is why the curve finds almost nothing to move.

6. Clipping: black is safe, white is not

Gamma pushes midtones upward, so pixels near the top can be carried over 255 and pinned there. On the landscape photo the pixels at 255 rose from 224,922 to 266,022, an increase of 41,100, while the pixels at 0 did not change at all. The grayscale JPEG is the clearest case: 1,815 pixels at 255 became 4,509.

FileAt 255 beforeAt 255 at gamma 2.2AddedAt 0 before and after
photo_landscape.jpg224,922266,02241,10013,322,665
photo_portrait.jpg226,363268,00641,64313,332,326
photo_square.png252,288288,23435,9464,465,260
gray_8bit.jpg1,8154,5092,69412,347,328
screenshot.webp20,73125,3764,6451,556,382
exif_orient6.jpg50,98359,8318,8483,291,795
logo_alpha.png0001,340,340
animation.gif000330,000

Counts are single-channel, summed across the three colour channels. The counts at 0 are identical before and after because the curve maps 0 to 0 exactly.

Your call: whether 41,100 newly pinned-white pixels matter depends on what is in them. On a sky or a white product background it is invisible; on a pale face it is detail you cannot recover with a second pass, because those pixels no longer hold a distinguishable value. Keep the originals and judge one frame in the folder before the rest.

7. Alpha, frames, depth and tags

The curve is applied per channel and does not touch the alpha channel. On the transparent logo the alpha bytes were identical before and after. Everything else about the container degrades if the output is re-encoded as an 8-bit PNG.

FileBeforeAfterNote
logo_alpha.pngRGBARGBAalpha bytes identical
animation.gif6 frames, indexed1 frameSaving the first frame as GIF reopened with one frame
gray_16bit.png16-bit, 65,536 levels8-bit, 256 levelsraw samples ran 0 to 65,535; after conversion to RGB the top 8 bits survived, 21 channel values sat at 255 before and 42 after
exif_orient6.jpgorientation tag 6no tag2000 x 1500 dims unchanged, tag dropped

The 16-bit case deserves its own line. Converting a 16-bit grayscale image to RGB first keeps only the high byte of each sample, so the curve runs on 256 levels instead of 65,536. That is why this file changed the smallest share of pixels in the whole batch: its brightest values were already at the maximum before gamma touched anything.

8. Bytes and repeatability

Eleven 8-bit PNG outputs totalled 58,329,648 bytes against 20,933,726 bytes of input, or 2.786 times the source. The ratio depends on the setting: gamma 0.8 wrote 62,791,305 bytes and gamma 0.5 wrote 61,265,833. The largest growth was the landscape JPEG, from 2,403,704 to 12,382,872 bytes at gamma 2.2.

Two independent full passes at gamma 2.2 produced byte-identical output. Both runs wrote 58,329,648 bytes and hashed to SHA-256 8e00682deaff4985fd6fb10dd9edd8c18242ea0c7f3294922283baf4dff30ec2 over the eleven PNG files in order. The first pass took 10.09 seconds and the second 10.05 seconds on this machine; the times are wall clock for the whole folder, not a per-file benchmark.

See all measured guides

Frequently asked questions

How do I adjust the gamma of an image?

Pick the gamma number first, then apply the same transfer curve to every file. In this batch a gamma of 2.2 raised the average channel value on photo_landscape.jpg from 93.213 to 119.435 and left 25.394 percent of the pixels untouched. Values under 1 pull the image darker and values over 1 lift it, and 1.0 is a no-op: zero pixels changed on all 11 files.

What does 1.0 mean?

Gamma 1.0 maps every input level to itself, so the output is the input. On this batch that was the only setting of seven that changed zero pixels, and the transfer ladder shows 16 to 16, 128 to 128 and 255 to 255. Anything other than 1.0 moves at least the midtones.

Does 1.0 leave the image unchanged?

In pixel values yes: 0 of 63,016,384 pixels differed at gamma 1.0. The file itself is not guaranteed identical. The output was written as an 8-bit RGBA PNG in every case, so a JPEG's bytes, a six-frame GIF's frames and a 16-bit grayscale file's depth all change even when no pixel value moves.

Does a higher gamma make an image brighter or darker?

Brighter, and only in the top half by design. On photo_landscape.jpg gamma 2.2 moved 22,452,413 of 36,000,000 channel values up by at most 72 and moved none down, while pure black stayed 0 and pure white stayed 255. The bottom of the range hardly moves: level 16 becomes 72, but level 240 becomes 248.

How do I change the gamma of an image online?

Load the file, set one gamma number, download the result. The part worth checking before you commit a folder is the level collapse: at gamma 2.2 the 256 possible input levels produced 184 distinct output values, so 72 values can never appear. Gamma 3.0 skipped 98.

What gamma value should I use?

This batch cannot answer that, and no single number survives it. The same 2.2 setting moved 66.017 percent of a landscape JPEG, 87.532 percent of a square PNG and 0.388 percent of a 16-bit grayscale file, because the share of pixels that move depends on where the file's values already sit. Choose the number from your output target, then check one file from the folder at full size.

Does it work on PNG images with transparency?

The alpha channel survived untouched: the transparent logo's alpha bytes were identical before and after gamma 2.2. What changes is the colour under partly transparent pixels, which moves like any other. Saving as PNG kept the alpha, while flattening to RGB first would have dropped it entirely.

Can gamma adjustment affect image quality?

It removes levels rather than adding noise. At gamma 2.2 the outputs held 184 of 256 possible values, and the transparent logo, which started with 5 levels, still had 5. The visible cost is banding risk in smooth gradients, not a grainier texture, and the largest single-pixel move on the landscape photo was 72 of 255.

How does gamma differ from brightness and contrast?

Brightness shifts every level by a fixed amount; gamma multiplies by a curve that is worth 0.5 at black, 1.0 at mid-gray and 2.0 at white. That is why gamma cannot lift a dark photo without also compressing its highlights: at gamma 2.2 the 85 to 170 band has a slope of 0.671 and the 170 to 255 band 0.506, while the 0 to 85 band has 1.824.

Does gamma change every pixel in a batch?

No, and the gaps are the surprise. Every setting except 1.0 changed about 68.2 percent of the batch, because the same share of the frame sits at pure black or pure white and those two values are fixed. Within that, a single file ranged from 0.388 percent on a 16-bit grayscale image to 87.532 percent on a square PNG at the same gamma 2.2.