{
  "id": 20199218,
  "title": "Linear Light Upscaling Is Correct, and It Cost Me 18 Shadow Levels",
  "url": "https://urgent.news/2026/11/15/linear-light-upscaling-is-correct-and-it-cost-me-18-shadow-levels",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-15T16:04:03.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/celticgemini001/linear-light-upscaling-is-correct-and-it-cost-me-18-shadow-levels-1m40"
  },
  "original_language": "en",
  "account": "The source material discusses various experiments comparing the performance of resampling images in linear light versus sRGB color space. The key points are:\n\n1. Resampling in linear light preserves more high-frequency detail compared to resampling in sRGB. This is because human contrast perception is roughly logarithmic, so resampling in linear light avoids wasting bits in less sensitive areas of the image.\n\n2. However, resampling in linear light also results in worse Peak Signal-to-Noise Ratio (PSNR) compared to sRGB. PSNR is a mean squared error over the whole image, and the linear pipeline spends its error where the eye is most sensitive - in the shadows.\n\n3. The magnitude of the error depends on the brightness of the source pixel. Below brightness value 128, sRGB resampling is more accurate in code values, while above value 128, linear resampling is more accurate. This creates a \"crossover\" point where the better pipeline depends on the brightness of the pixels being resampled.\n\n4. When a linear intermediate is quantized to 8-bit before storing, it loses some distinct levels compared to the original float buffer. This quantization error manifests as banding in dark shadows, reducing image quality. Keeping the buffer as float avoids this issue, but requires more memory.\n\n5. The source material concludes that the choice between resampling in linear light or sRGB depends on the specific use case and the importance of preserving detail versus minimizing PSNR. For images with a wide range of brightness values, keeping the buffer as float and only converting to sRGB for storage is recommended to maintain the highest image quality.",
  "summary": "Every resampling article opens with the same demo: downscale a black-and-white checkerboard in sRGB, get a muddy grey that should have been mid-grey, then do it in linear light and get the right answer. The demo is correct. I have reproduced it. Then I took that conclusion — \"always resample in linear light\" — and applied it to a real 512×512 photograph, and to a shadow gradient, and to an…",
  "key_points": [
    "Resampling in linear light preserves high-frequency detail better than sRGB.",
    "Linear resampling results in worse PSNR compared to sRGB, wasting bits in shadows.",
    "Quantizing linear intermediate to 8-bit causes banding in dark shadows, reducing quality."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}