Tone Curve Manipulation
Detects brightness, contrast, gamma, and levels adjustments that may have been applied to hide or exaggerate content, such as darkening a background to suppress a faint band or stretching the tonal range with a Levels or Curves tool.
Technical description
Combines three signals on the grayscale image. Signal A detects the histogram comb that a pointwise tone map leaves in quantized pixels. Its core is the Stamm-Liu intrinsic fingerprint: the 256-bin histogram is normalised to a probability density function (pdf) p, its smooth envelope p_smooth is a 9-bin moving average, and the high-frequency energy is hist_hf_ratio = sum(r^2)/sum(p^2) with r = p - p_smooth, flagged when above 0.40. Two supporting measures are a discrete Fourier transform (DFT) peak ratio comb_ratio = max(|DFT(p)| over band 2..64) / median baseline (flag > 6.0), and the empty-bin fraction inside the occupied range zero_ratio_active (flag > 0.15). Signal B fits the cumulative distribution function (CDF) in log-log over the central mask 0.02 < CDF < 0.98 to a line log(CDF) = slope*log(x) + b; the slope (gamma_est) is a tone-slope proxy flagged only when extreme (< 0.5 heavy darkening, > 4.0 heavy brightening), since an ordinary sRGB image is legitimately gamma-encoded. Signal C tiles the image into 16x16 blocks and flags a block whose mean luminance has an 8-neighbour z-score |z| > 2.8. The score sums the three contributions, each capped at 2.5, clamped to min(5.0, comb_score + gamma_score + luma_score).
How it works
Layer 1 (deterministic). Converts the image to grayscale and runs three signals. Signal A builds the 256-bin histogram and computes the Stamm-Liu high-frequency fingerprint (residual energy after a 9-bin smoothing), a Fourier peak ratio, and the empty-bin fraction in the active range. Signal B fits the cumulative distribution to a power law in log-log and flags an extreme tonal slope. Signal C compares each 16x16 block's mean luminance to its 8 neighbours by a z-score. The capped contributions are summed into the 0 to 5 score. Reports comb_ratio, comb_peak_freq, hist_hf_ratio, zero_ratio_active, gamma_est, gamma_r2, luma_anomaly_blocks, total_blocks, and active_range.
Why this matters
Adjusting brightness, contrast, and gamma is among the easiest ways to misrepresent image data, and the foundational guidance on scientific image handling singles out these operations, warning that altering the tonal range can improperly obscure faint features or enhance weak signal and that such changes to original data can constitute misconduct. The digital-image ethics guidelines likewise treat non-linear contrast and gamma adjustments that selectively reveal or suppress information as inappropriate manipulation. These operations are detectable because a pointwise tone map applied to quantized pixels leaves an intrinsic statistical fingerprint of peaks and gaps in the histogram, the same nonlinearity that makes blind gamma estimation possible, so both whole-image tone maps and selective local edits can be surfaced from the published pixels alone.
Score thresholds
- 0-1
- Smooth histogram, normal tonal slope, and consistent regional brightness; no tone-curve manipulation
- 2-3
- One signal fires: a histogram comb, an extreme tonal slope, or a few selectively adjusted regions to inspect
- 4-5
- Multiple signals fire together, indicating deliberate tonal manipulation to hide or exaggerate content
Limitations
The histogram fingerprint depends on quantization structure, so heavy lossy compression, dithering, or strong noise can blur the comb while a naturally peaky histogram raises the high-frequency ratio, which is why the threshold sits well above the level of smooth natural images. The cumulative-distribution slope is a proxy rather than a calibrated gamma, because it conflates the applied map with the scene's intrinsic intensity distribution, so it only flags extreme darkening or brightening. The regional luminance signal uses a fixed 16-pixel grid and assumes brightness varies smoothly between neighbours, so a sharp legitimate boundary can contribute anomalies and a feathered edit can escape the per-block z-score. Only the luminance channel is analysed, so a manipulation confined to one colour channel is left to the colour and histogram indicators.
References
- Stamm MC, Liu KJR. (2010). Forensic Detection of Image Manipulation Using Statistical Intrinsic Fingerprints. IEEE Transactions on Information Forensics and Security 5(3):492-506
- Farid H. (2001). Blind inverse gamma correction. IEEE Transactions on Image Processing 10(10):1428-1433
- Rossner M, Yamada KM. (2004). What's in a picture? The temptation of image manipulation. Journal of Cell Biology 166(1):11-15
- Cromey DW. (2010). Avoiding Twisted Pixels: Ethical Guidelines for the Appropriate Use and Manipulation of Scientific Digital Images. Science and Engineering Ethics 16(4):639-667