I am a little bit confused about image capturing by Raspberry pi camera V2.1 [1]. I work on the Raspberry pi 4 and I know how to get 8-bit depth black and white (BW) image from it on the C++ level with e.g. raspicam library [2] - so the images pixel values are in the range 0-255. But in the product description and many others shopping descriptions, we can find that this camera based on SONY IMX219 sensor [3] is able to capture 10-bit depth raw image (also it is mentioned in the [1]) - so in range 0-1023. How to achieve such depth of image? Best scenario is to get it on the C++ level, without OpenCV, but after few days of searching I can deal with any kind of information about it ;) . Maybe there is different camera with similar parameters to above, but with higher than 8-bit depth in default?

All the best.

[1] https://www.raspberrypi.org/documentation/hardware/camera/

[2] https://github.com/cedricve/raspicam

[3] https://botland.com.pl/index.php?controller=attachment&id_attachment=1950

  • You can see here for an example of raw datas extraction.
    – Ephemeral
    Mar 5, 2020 at 14:55

1 Answer 1


From picamera.readthedocs.io, 5.11. Raw Bayer data captures :

Bayer data consists of 10-bit values, because this is the sensitivity of the OV5647 sensor used by the Pi’s camera. The 10-bit values are organized as 4 8-bit values, followed by the low-order 2-bits of the 4 values packed into a fifth byte.

You can read this code for an example of raw datas extraction from raspistill raw capture.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.