Software
Picamera2
By Raspberry Pi, United Kingdom (checked on github.com/raspberrypi (opens in a new tab)), from github.com/raspberrypi/picamera2 (opens in a new tab)
- Perception
- Driver or SDK
- BSD-2-Clause
Picamera2 is a Python library for controlling Raspberry Pi cameras through the libcamera stack, replacing the older Picamera library. It offers an easy-to-use Python API.
Facts
- GitHub stars
- 1,256read on 28 Nov 2026
- Last update
- 4 Nov 2026Newest commit on main
- Maintenance
- Activea commit in the last 90 days
- Difficulty
- Beginner
- Hardware it needs, as the project states it
- Runs on Raspberry Pi boards, from the Pi Zero upward, with performance varying on less powerful devices; requires Raspberry Pi OS Bullseye or later (32 or 64-bit) with the legacy camera stack disabled.
Checked on GitHub on 28 Nov 2026.
Licenses
- Code
- BSD-2-Clause (opens in a new tab)
Read by Robotheca from LICENSE (opens in a new tab) (BSD-2-Clause) at commit ae3f32f (opens in a new tab), on 6 Nov 2026.
- Commercial use
- Yes
At a glance
- What it is
- Replaces the legacy Picamera Python interface with a libcamera-based implementation.
- Provides an easy-to-use Python API for camera control.
- Documentation, many examples, Qt application examples, and an automated test suite are available in separate repositories.
- Still in beta, with work focused on bugs, stability, support, examples, documentation and keeping up with libcamera development.
- Can be installed via apt, which is recommended to match versions with libcamera, or via pip.
- Development for upcoming releases happens on the "next" branch, while "main" matches the released version.
Robotheca's summary of the project's documents, not the creator's words.
- Robots on Robotheca
- No robot on Robotheca uses it yet.
- Licence
- BSD-2-Clause. Commercial use: Yes. Where it was read
- Install
- In the creator's words: The project's README (opens in a new tab)
- Maintenance
- Active, last commit on 4 Nov 2026.
Use it
How to install it, in the creator's words: The project's README (opens in a new tab)
Robotheca doesn't review code. Read it before running it.
Files and versions
- Repository on GitHubgithub.com/raspberrypi/picamera2 (opens in a new tab)
- The version Robotheca readae3f32f (opens in a new tab)
- Latest releaseRelease 0.3.39 (4 Nov 2026)
Robotheca read the repository at two versions: the summary at 5e2a35d and the facts and the README at ae3f32f (read on 28 Nov 2026).
Robotheca never hosts the code: each link goes to the creator's own page.
The README
The creator's own README, copied as written: README.md by Raspberry Pi, at commit ae3f32f, under BSD-2-Clause (opens in a new tab). The original on GitHub (opens in a new tab).
Read the README here
Picamera2
Picamera2 is currently available here as a beta release. This means there may still be some issues and bugs which we shall work on fixing, and where users identify particularly useful features we may still consider implementing them. Mostly we shall be working on bugs, stability, support, examples and documentation, as well as keeping up with ongoing libcamera development. There will also be quite a strong presumption against making signficant code changes unless it seems absolutely necessary, especially any that break existing behaviour or APIs.
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 (opens in a new tab) 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 (opens in a new tab) repository.
Installation
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:
- Images based on Buster or earlier releases.
- Raspberry Pi OS Legacy images.
- Bullseye (or later) images where the legacy camera stack has been re-enabled.
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.
Contributing
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:
- Restricted to one change or feature each. Please try to avoid "drive-by fixes" especially in a larger set of changes, as it can make them harder to review.
- The commit history should consist of a number of commits that are as easy to review as possible. In particular this means:
- Where one commit is fixing errors in an earlier commit in the set, please simply merge them.
- Where a commit is reverting a commit from earlier in the set, please remove the commit entirely.
- Please avoid adding merge commits or any other unnecessary commits.
- The commit message should have a short single line at the top which is nonetheless as descriptive as possible. After that we encourage more lines explaining in a little more detail exactly what has been done.
- In general, we don't need to see all the trials, errors and bug-fixes that went into this change, we only want to understand how it works now!
- Try to ensure that the automated tests are working after all the commits in the set. This avoids other developers going back to an arbitrary earlier commit and finding that things don't work. There can be occasions when other problems cause test failures beyond our control, so we'll just have to remain alert to these and work around them as best we can.
- Where changes are likely to be more involved, or may change public APIs, authors should start a discussion with us first so that we can agree a good way forward.
- Before submitting a pull request, please ensure that all the automated tests are passing. They live in the picamera2-examples (opens in a new tab) repository and can be run using its
run_tests.pyscript. Please userun_tests.py --helpfor more information. - Any documentation should be updated accordingly. New examples and tests should be included wherever possible, as pull requests against the picamera2-examples repository. Also consider making an entry in the change log.
- The author of the pull request needs to agree that they are donating the work to this project and to Raspberry Pi Ltd., so that we can continue to distribute it as open source to all our users. To indicate your agreement to this, we would ask that you finish commit messages with a blank line followed by
Signed-off-by: Your Name <your.email@your.domain>. - We'd like to conform to the common Python PEP 8 coding style wherever possible. To facilitate this we would recommend using our pre-commit hook, which can be installed by doing the following in the root of the repository:
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!
Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.