{
 "id": "reinhard-tonemapping",
 "title": "Reinhard photographic tone reproduction",
 "aliases": [
  "Reinhard operator"
 ],
 "domain": "post",
 "subdomain": "tonemapping",
 "stage": "post",
 "realtime": "realtime",
 "platforms": [
  "webgl2",
  "webgpu",
  "desktop-gpu",
  "mobile-gpu",
  "blender"
 ],
 "year_introduced": 2002,
 "inputs": [
  "hdr-image"
 ],
 "outputs": [
  "ldr-image"
 ],
 "style": "photoreal",
 "dynamic": "both",
 "summary": "The classic global operator x/(1+x), scaled by the scene's log-average luminance to a chosen key value, plus an extended form with a white point; simple, monotonic and well behaved.",
 "how_it_works": "Reinhard et al. borrow the zone system from photography. First, the log-average (geometric mean) luminance of the image is computed and the image is scaled so that this average maps to a key value, like 0.18 for a mid-tone scene. The global curve L/(1+L) then compresses the range into [0,1). The extended version divides by a white point, L(1+L/Lw^2)/(1+L), so values at Lw map to exactly 1. The paper also describes a local dodge-and-burn variant using multi-scale blurred luminance, though the global form is the one used in real-time. Applied per channel the curve desaturates highlights; applied to luminance only, hues are preserved but colours can go out of gamut.",
 "when_to_use": "Choose it when you want a simple, invertible, predictable curve, for example as a debug view or for TAA's luminance-weighted resolve.\n\nPrefer `hable-filmic-tonemapping` for more contrast and a toe, `aces-tonemapping` for film response, and `khronos-pbr-neutral` for colour accuracy. Combine with `auto-exposure-histogram` to supply the key.",
 "cost": {
  "class": "cheap",
  "notes": "Per-pixel arithmetic only."
 },
 "failure_modes": [
  "Low-contrast, washed-out blacks because it lacks a toe",
  "Per-channel application desaturates and shifts hue in bright colours",
  "Highlights compress hard unless a white point is set",
  "Luminance-only variant can push saturated colours out of gamut"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1145/566570.566575",
   "type": "paper",
   "title": "Photographic tone reproduction for digital images",
   "authors": [
    "Erik Reinhard",
    "Michael Stark",
    "Peter Shirley",
    "James Ferwerda"
   ],
   "year": 2002,
   "venue": "Proceedings of the 29th annual conference on Computer graphics and interactive techniques",
   "url": "https://doi.org/10.1145/566570.566575",
   "ids": {
    "doi": "10.1145/566570.566575"
   },
   "license": null,
   "extra": {
    "csl_type": "proceedings-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/566570.566575",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/566570.566575",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/566570.566575",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/566570.566575",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/566570.566575",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "reinhard2002photographic"
  },
  {
   "role": "implementation",
   "key": "gh:mrdoob/three.js",
   "type": "code",
   "title": "mrdoob/three.js",
   "description": "JavaScript 3D Library.",
   "authors": [
    "mrdoob"
   ],
   "year": 2010,
   "venue": "GitHub",
   "url": "https://github.com/mrdoob/three.js",
   "ids": {
    "repo": "mrdoob/three.js"
   },
   "license": "MIT",
   "extra": {
    "stars": 119718,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2026-11-29T11:39:51Z",
    "language": "JavaScript",
    "homepage": "https://threejs.org/",
    "license_name": "MIT License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/three.js",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/three.js",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/three.js",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/three.js",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/three.js",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/three.js",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "mrdoob2010mrdoob"
  }
 ],
 "presets": [
  {
   "id": "reinhard-tonemapping-specimen",
   "title": "Three HDR exposure ramps (grey, orange, cyan). Left: clamp. Right: extended Reinhard on luminance",
   "runtime": "glsl-fragment",
   "params": {
    "LW": 16
   },
   "code": "float hash(vec2 c){uvec2 u=uvec2(ivec2(floor(c)));uint h=u.x*1597334673u^u.y*3812015801u;h^=h>>15;h*=2246822519u;h^=h>>13;h*=3266489917u;h^=h>>16;return float(h)*(1./4294967296.);}\nfloat lum(vec3 c){return dot(c,vec3(.2126,.7152,.0722));}\nvec3 gam(vec3 c){return pow(clamp(c,0.,1.),vec3(1./2.2));}\n\nconst float LW=16.0; // P\nvoid mainImage(out vec4 fragColor,in vec2 fragCoord){\n  vec2 uv=(fragCoord-.5*iResolution.xy)/iResolution.y;bool R=uv.x>0.;vec2 q=vec2(uv.x+(R?-.25:.25),uv.y);\n  float e=exp2(mix(-4.,5.,clamp((q.x+.25)/.5,0.,1.)));\n  int row=int(clamp(floor((uv.y+.5)*3.),0.,2.));\n  vec3 base=row==0?vec3(.1,.7,1.):(row==1?vec3(1.,.45,.12):vec3(1.));\n  vec3 c=base*e*.3;\n  vec3 col;\n  if(!R) col=gam(c);\n  else{float L=lum(c),Ld=L*(1.+L/(LW*LW))/(1.+L);col=gam(c*Ld/max(L,1e-5));}\n  if(fract((uv.y+.5)*3.)<.01)col=vec3(.1);\n  if(abs(uv.x)<.0015)col=vec3(1.);\n  fragColor=vec4(col,1.);\n}",
   "basis": "original",
   "license_note": "written for this index",
   "execution_fidelity": "faithful-pass",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-29",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "reinhard-tonemapping",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-29T15:51:50.471Z",
     "renderer": "Chromium 145.0.7632.6 headless, WebGL2 via ANGLE/SwiftShader, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.5478,
      "std": 0.2947,
      "unique_colors": 76
     },
     "image": "/specimens/reinhard-tonemapping-specimen.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "hable-filmic-tonemapping",
  "aces-tonemapping",
  "khronos-pbr-neutral"
 ],
 "extends": [],
 "supersedes": [],
 "combines_with": [
  {
   "id": "auto-exposure-histogram",
   "why": "The measured log-average luminance sets Reinhard's key scaling."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/post/reinhard-tonemapping.json"
 },
 "solves": [
  "hdr values need squeezing to displayable range simply",
  "want an invertible predictable tone curve",
  "need debug view of hdr with no contrast boost",
  "taa resolve needs well-behaved luminance weighting"
 ],
 "authority": "Reinhard et al., 2002",
 "url": "https://texelatlas.vercel.app/t/reinhard-tonemapping/",
 "execution_fidelity": "faithful-pass",
 "fidelity_label": "Faithful Pass",
 "benchmark_eligible": true,
 "gpu_weight": {
  "weight_x": 1.16,
  "tier": "feather",
  "p50_ms": 0.0383,
  "p95_ms": 0.0399,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "reinhard-tonemapping-specimen",
  "execution_fidelity": "faithful-pass",
  "fidelity_label": "Faithful Pass",
  "benchmark_eligible": true,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 1.01,
   "tier": "feather",
   "p50_ms": 0.016,
   "p95_ms": 0.0161,
   "speedup_x": 2.39,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 1,
   "tier": "feather",
   "p50_ms": 0.0288,
   "p95_ms": 0.0288,
   "speedup_x": 1.33,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}