Libcamera saved JPEGs pink and grainy but preview clear on Pi 4B with Arducam IMX477

I’m having a strange issue with my new Arducam HQ camera. When I use libcamera to preview, the image on screen is crystal clear. But the JPEG I save with libcamera-still comes out pink and grainy. Anyone know what could cause that?

Thanks for the report. Can you share a bit more about your setup - which Pi model, OS version, and the exact camera module you’re using? Also, what’s in your /boot/config.txt?

Here are the details:

  • Raspberry Pi 4B, 4GB
  • Raspberry Pi OS Bookworm, fully updated
  • Arducam for Raspberry Pi HQ Camera, 12.3MP IMX477 High Sensitivity CMOS, with C-CS Adapter and Tripod Mount

config.txt has:

dtoverlay=imx477
camera_auto_detect=0

I already modified config.txt as directed and rebooted, but the saved JPEG is still pink and grainy.

Got it. Could you post the saved JPEG and a screenshot of the live preview so we can see the difference?

Sure, here’s the saved JPEG (test.jpg) and what the camera shows during live preview (CameraDisplaysCorrectly.png):

test.jpg

CameraDisplaysCorrectly.png

Thanks for the images. Based on the pink/grainy output with a 12MP IMX477 and a CS lens on a CS adapter, there are two likely causes:

  1. The CS lens doesn’t have an IR cut filter.
  2. A lens shading problem.

A pink and grainy image is often caused by a missing IR filter on the lens, or by a lens shading issue. Can you confirm two things:

  • Does your CS lens have an IR filter?
  • What’s the FOV (field of view) of the CS lens?

That was exactly it. The pink/grainy JPEG issue is because my new camera is missing an IR cut filter. I assumed the new camera had an IR cut filter like my older camera, but it turns out it doesn’t.

Good to know. And what lens are you using, and what’s its FOV? Just want to confirm it’s the lens rather than something on the sensor side.

The lens is an Arducam 120° FOV with no IR filter. Since the live preview looked fine I never suspected the lens at first. I’m going to order a new HQ camera that actually has the IR cut filter built in.

That confirms it. The missing IR cut filter lets IR light reach the sensor, which shows up as the pink/grainy cast in the saved JPEG. The live preview and still capture pipelines also process the image differently, which is why the preview can look okay while the saved file doesn’t. Once you switch to a camera/lens with an IR cut filter, the saved JPEGs should match what you see on screen. Thanks for updating the thread!