How to save 12bit raw data with IMX462 camera

Hello, I am using IMX462 camera with raspberry PI 4B.

I want to save as raw data(12bit data)

Whenever I try to save as raw data, it saved as .dng
I saved it in 1920x1080 resolution but it is saved in 120x67 resolution.

Is there any possible way that I can save as 12 bit raw data?

  • if possible, can you tell me how to handle the raw data as Python?

Thank you.

Hi,
Thank you for reaching out.
.dng vs. “Raw Data” : A .dng (Digital Negative) file is a raw data format. It’s an Adobe standard that encapsulates the sensor’s raw Bayer pattern data along with essential metadata (camera model, lens, ISO, shutter speed, white balance settings, black levels, color matrices, etc.). This metadata is crucial for the proper interpretation and processing of the raw image later. If you want a pure binary dump without any header, that’s also possible, but it makes interpretation much harder.

The reason you see a 120x67 pixel image is almost certainly because you are opening the .dng file in a standard image viewer (like Windows Photo Viewer, macOS Preview, a web browser, or a basic Linux image viewer like Eye of GNOME).
How to Properly Verify the DNG File’s Full Resolution:

To confirm that your DNG file indeed contains the full 1920x1080 raw data, you need to use tools designed for raw image processing or metadata inspection:

  1. Command-Line Tools (on your Raspberry Pi or a connected computer):
  • exiftool : A powerful tool for reading and writing image metadata.
sudo apt install libimage-exiftool-perl 
exiftool my_imx_raw_12bit.dng

Thank you for the information.
I check the dng file with exiftool.
I still have same questions

  1. The BitsPerSample of data is [8 8 8] eventhough I tred to save as 12bit.

Is there any possible way that I can save as 12bit?
The below is the code that I used to save as raw data.

libcamera-still -t 1000 --raw -o mipi_capture.raw

Hi,
Please check here: