A DEV Community post tests the common advice to always resize images in linear light. Linear light means converting from the sRGB encoding, which stores brightness non-linearly, back to physical light levels before averaging pixels. The author ran seven experiments on one 512x512 greyscale photo crop, using numpy 1.26.4 and Pillow 12.2.0. Two of the results contradict the advice the author started with.
In a 4x downscale and upscale round trip, linear light kept more fine detail. According to the post, the gain was 1.12 percentage points with a bilinear filter and 3.52 with lanczos. But it also scored worse on PSNR, a standard error measure, by 0.98 dB with bilinear and 1.19 dB with lanczos. The author says the linear pipeline puts its error in the shadows, where the eye is most sensitive. Error bucketed by brightness showed sRGB resizing was more accurate below value 128 and linear was more accurate above it.
Storage matters too. When the author kept a linear-light intermediate as an 8-bit file, a smooth dark gradient of 41 distinct values came out with only 23. Eighteen levels were lost, which produces visible banding. Keeping the intermediate in float fixed it. The post says an 8-bit linear intermediate is worse than not converting at all.
Other findings: if you can only convert once, do it on the downscale, which delivered 99% of the detail gain in the test. Switching the filter from nearest to lanczos was worth 3.69 dB, more than the colour space change. An unsharp mask, a common sharpening method, produced 33% more halo in linear light, mostly dark-side undershoot, so the author sharpens in sRGB. The author notes the limits: one photograph, and PSNR is not a perceptual measure.
Why it matters
Resizing advice is often given as a single rule. This test suggests the right setup depends on the step, the storage format and the image. Dark or low-key images, such as night scenes or moody product shots, are the ones most exposed to shadow errors and banding. The author says such images could push the shadow penalty much harder.
The results are from one photo and one author, so treat them as a guide rather than proof. Still, they point to practical checks: which filter your tool uses, whether intermediate files are 8-bit, and whether sharpening happens before or after resizing.
Source: DEV Community. This brief summarises their reporting; read the original for the full detail.