Picamera2 is the libcamera-based replacement for Picamera which was a Python interface to the Raspberry Pi's legacy camera stack. Picamera2 also presents an easy to use Python API.
You can find documentation here which should help you to get started.
There are also many examples, some further Qt application examples and the automated test suite in the separate picamera2-examples repository.
Picamera2 is only supported on Raspberry Pi OS Bullseye (or later) images, both 32 and 64-bit. As of September 2022, Picamera2 is pre-installed on Raspberry Pi OS images, but not on Raspberry Pi OS Lite images. It works on all Raspberry Pi boards right down to the Pi Zero, although performance in some areas may be worse on less powerful devices.
Picamera2 is not supported on:
On systems where Picamera2 is supported but not pre-installed, you can install it with
sudo apt install python3-picamera2 --no-install-recommends
to get a slightly reduced installation with fewer of the window system related elements (this would be suitable for installing on a Raspberry Pi OS Lite system), or
sudo apt install python3-picamera2
for a full installation.
Picamera2 can be installed using pip, however, we recommend installing through apt as this guarantees you will get versions of Picamera2 and the underlying libcamera libraries that have been confirmed as working together.
Please note that the "main" branch of this repository corresponds to the currently released version of Picamera2 so that the examples there can be referred to by users. Development for forthcoming releases happens on the "next" branch.
We are happy to receive pull requests (normally for the "next" branch) that will fix bugs, add features and generally improve the code. Pull requests should be:
run_tests.py script. Please use run_tests.py --help for more information.Signed-off-by: Your Name <your.email@your.domain>.pip3 install pre-commit
pre-commit install
This will install flake8 in a venv and will perform linting of changes prior to committing.
Thank you!
168 followers · starred Sep 2025
208 followers · starred May 2022
1,775 followers · starred Dec 2023
701 followers · starred Sep 2022
Picamera2 is the libcamera-based replacement for Picamera which was a Python interface to the Raspberry Pi's legacy camera stack. Picamera2 also presents an easy to use Python API.
You can find documentation here which should help you to get started.
There are also many examples, some further Qt application examples and the automated test suite in the separate picamera2-examples repository.
Picamera2 is only supported on Raspberry Pi OS Bullseye (or later) images, both 32 and 64-bit. As of September 2022, Picamera2 is pre-installed on Raspberry Pi OS images, but not on Raspberry Pi OS Lite images. It works on all Raspberry Pi boards right down to the Pi Zero, although performance in some areas may be worse on less powerful devices.
Picamera2 is not supported on:
On systems where Picamera2 is supported but not pre-installed, you can install it with
sudo apt install python3-picamera2 --no-install-recommends
to get a slightly reduced installation with fewer of the window system related elements (this would be suitable for installing on a Raspberry Pi OS Lite system), or
sudo apt install python3-picamera2
for a full installation.
Picamera2 can be installed using pip, however, we recommend installing through apt as this guarantees you will get versions of Picamera2 and the underlying libcamera libraries that have been confirmed as working together.
Please note that the "main" branch of this repository corresponds to the currently released version of Picamera2 so that the examples there can be referred to by users. Development for forthcoming releases happens on the "next" branch.
We are happy to receive pull requests (normally for the "next" branch) that will fix bugs, add features and generally improve the code. Pull requests should be:
run_tests.py script. Please use run_tests.py --help for more information.Signed-off-by: Your Name <your.email@your.domain>.pip3 install pre-commit
pre-commit install
This will install flake8 in a venv and will perform linting of changes prior to committing.
Thank you!
168 followers · starred Sep 2025
208 followers · starred May 2022
1,775 followers · starred Dec 2023
701 followers · starred Sep 2022