rawpy
RAW image processing for Python, a wrapper for libraw
What it is and what it does
rawpy is a Python wrapper around the LibRaw C++ library that handles the low-level decoding of RAW image files from digital cameras. It lets you load RAW files (NEF, CR2, ARW, DNG, and many others), extract metadata and embedded thumbnails, and apply postprocessing such as demosaicing, white balance, gamma correction, and output bit depth control. The package also includes utilities in the `rawpy.enhance` module for detecting and repairing hot and dead pixels across multiple images.
The library is built as precompiled wheels for Python 3.9 through 3.14 on Linux, macOS, and Windows, with optional features like LCMS color management and OpenMP acceleration available on most platforms. It depends only on numpy and is designed for straightforward use in image processing pipelines, from simple one-line postprocessing to advanced workflows involving pixel repair and batch processing.
Use it for:
- Load and postprocess RAW files from digital cameras with custom white balance, gamma, and bit depth settings.
- Extract and save embedded thumbnail images from RAW files without full decoding.
- Identify and repair hot/dead pixels across a series of RAW images using statistical analysis.
- Build batch RAW processing pipelines that apply consistent postprocessing parameters to multiple images.
- Access raw sensor data and metadata for scientific or forensic image analysis.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
rawpy wraps LibRaw to load, decode, and postprocess RAW image files from digital cameras, with built-in functions for finding and repairing hot and dead pixels.
Yes. rawpy is actively maintained, has no known vulnerabilities, and provides the most straightforward Python interface to LibRaw for RAW image processing. Install it if you need to work with RAW files from digital cameras. Be aware of the medium install friction (compiled wheels) and the Linux multiprocessing fork() caveat documented in the FAQ.
Install
rawpy on PyPI
pip
pip install rawpyuv
uv add rawpypoetry
poetry add rawpyInstalling rawpy
Before you install
Medium install friction due to compiled wheels for multiple Python versions (3.9–3.14) and platforms. Package is actively maintained with recent commits and no known vulnerabilities. Depends only on numpy, keeping the dependency tree lean.
License in practice
MIT license is permissive and imposes no restrictions on use, modification, or distribution. Note that GPL demosaic packs are intentionally excluded from wheels due to license incompatibility with MIT.
Quickstart
pip install rawpy
import rawpy
import numpy
with rawpy.imread('image.nef') as raw:
rgb = raw.postprocess()
LibRaw library must be available on the system; on Linux, manual installation from source may be required if the system package is outdated or missing.
Verify before relying
- Whether all supported camera models and RAW formats are documented or queryable at runtime.
- Performance characteristics when processing large batches of RAW files or very high-resolution images.
- Stability and thread-safety guarantees beyond the documented multiprocessing fork() caveat.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | actively maintained — 99 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 531,979/month — #6,151 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: rawpy-0.27.0-cp310-cp310-macosx_11_0_arm64.whl; rawpy-0.27.0-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; rawpy-0.27.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; rawpy-0.27.0-cp310-cp310-win_amd64.whl; rawpy-0.27.0-cp311-cp311-macosx_11_0_arm64.whl; rawpy-0.27.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; rawpy-0.27.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; rawpy-0.27.0-cp311-cp311-win_amd64.whl; rawpy-0.27.0-cp312-cp312-macosx_11_0_arm64.whl; rawpy-0.27.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; rawpy-0.27.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; rawpy-0.27.0-cp312-cp312-win_amd64.whl; rawpy-0.27.0-cp313-cp313-macosx_11_0_arm64.whl; rawpy-0.27.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; rawpy-0.27.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; rawpy-0.27.0-cp313-cp313-win_amd64.whl; rawpy-0.27.0-cp314-cp314-macosx_11_0_arm64.whl; rawpy-0.27.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; rawpy-0.27.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; rawpy-0.27.0-cp314-cp314-win_amd64.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
img2pdfConverts raster images to PDF without…
copyleft · top 5,000 on PyPI
pygrabberCapture photos and video from Windows cameras…
permissive · top 15,000 on PyPI
pytapoPyTapo is a Python library that communicates…
permissive · top 15,000 on PyPI
pypngPyPNG reads and writes PNG image files in pure…
permissive · top 5,000 on PyPI
pyrealsense2Python wrapper for Intel RealSense SDK 2.0 that…
permissive · top 15,000 on PyPI
pylibjpeg-libjpegDecodes JPEG and JPEG-LS images to NumPy…
copyleft · top 15,000 on PyPI
healpyhealpy wraps the HEALPix C++ library to handle…
copyleft · top 15,000 on PyPI
dllistLists the shared libraries (DLLs) currently…
permissive · top 15,000 on PyPI
dxcamDXcam captures screen frames on Windows at high…
permissive · top 15,000 on PyPI
piexifPiexif reads, writes, and manipulates EXIF…
permissive · top 5,000 on PyPI