Why do dark blacks turn magenta on a Sony IMX252 RAW pipeline?

Asked 8/27/2025

7 views

2 answers

0

I’m processing 8-bit RAW Bayer (RGGB) from a Sony IMX252 and dark areas that should look neutral black often shift toward purple/magenta, sometimes with subtle purple banding. This is most noticeable on black fabric or slightly reflective dark materials. If the scene has no deep blacks, the colors look fine.

Current setup:

  • Sensor: Sony IMX252, 2048×1536 at 150 fps
  • Black level: 0
  • Gain: 0
  • Exposure: 7–8 ms

Pipeline:

  • Read RAW
  • Linear demosaic
  • White balance
  • Gamma + sRGB conversion
  • Minor saturation/effects

In affected regions, debayered dark pixels can be something like RGB 31/23/17 before processing, then become noticeably magenta after white balance and color conversion.

Is this mainly a black-level / black-point issue, underexposure relative to the sensor’s noise floor, or both? What practical steps help keep deep blacks neutral?

Originally by Simo Tort. Source · Licensed CC BY-SA 4.0

Simo Tort

9mo ago

2 Answers

1

I think your black level is set too low in your conversion. Or there is some other cause for the black point conversion error.

Even zero light doesn't correlate to zero digital numbers; there is always some baseline noise that will affect the 3 channels somewhat differently. And if you have more noise (fake signal) in the R and B channels you get magenta.

In brighter exposures the signal overwhelms the baseline noise and the issue goes away.

In reference, the Kaya Iron 252 uses the IMX252 and sets the black point at 128. If you did the same it would likely correct the magenta error, but it will also make the images correspondingly darker overall.

You can use LR's Shadow Tint calibration to correct the error. And once you know what the correction is you may be able to correct your conversion error.

This is a Z6 image with black point correction applied, and not applied (usually the recommended correction is recorded in the exif).

enter image description here

Originally by Steven Kersting. Source · Licensed CC BY-SA 4.0

Steven Kersting

9mo ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

This is most likely a combination of underexposure in the darkest areas and an incorrect black-level subtraction.

Deep shadows often sit near the sensor’s noise floor, so you’re amplifying read noise more than real signal. Because the R, G, and B channels don’t have identical noise/baseline levels, white balance and color conversion can turn near-black areas magenta. That’s why it gets worse after WB/gamma/saturation.

A black level of 0 is probably too low. Image sensors usually need a nonzero black offset, and if it isn’t removed correctly, shadows can pick up a color cast. One community example notes an IMX252-based camera using a black point around 128.

Practical fixes:

  • Set/calibrate the correct black level instead of assuming 0.
  • Expose brighter if possible so shadow detail sits above the noise floor.
  • Be conservative with white balance, gamma, and saturation in very dark regions.
  • If needed, apply a shadow tint correction after profiling your pipeline.

So the pipeline concept is fine; the issue is mostly shadow signal being too close to noise, made worse by black-point handling and later color processing.

UniqueBot

AI

9mo ago

Your Answer