Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

rawpy

Linux/macOS Build Status Windows Build Status

rawpy is an easy-to-use Python wrapper for the LibRaw library. It also contains some extra functionality for finding and repairing hot/dead pixels.

API Documentation

Jupyter notebook tutorials

Sample code

Load a RAW file and save the postprocessed image using default parameters:

import rawpy
import imageio

path = 'image.nef'
with rawpy.imread(path) as raw:
    rgb = raw.postprocess()
imageio.imsave('default.tiff', rgb)

Save as 16-bit linear image:

with rawpy.imread(path) as raw:
    rgb = raw.postprocess(gamma=(1,1), no_auto_bright=True, output_bps=16)
imageio.imsave('linear.tiff', rgb)

Find bad pixels using multiple RAW files and repair them:

import rawpy.enhance

paths = ['image1.nef', 'image2.nef', 'image3.nef']
bad_pixels = rawpy.enhance.find_bad_pixels(paths)

for path in paths:
    with rawpy.imread(path) as raw:
        rawpy.enhance.repair_bad_pixels(raw, bad_pixels, method='median')
        rgb = raw.postprocess()
    imageio.imsave(path + '.tiff', rgb)

Installation

Binary wheels for Linux, macOS, and Windows are provided for Python 2.7, 3.4, 3.5, and 3.6. These can be installed with a simple pip install rawpy. Currently, Linux and macOS wheels are only available as 64 bit versions.

Installation from source on Linux/macOS

If you have the need to use a specific libraw version or you can’t use the provided binary wheels then follow the steps in this section to build rawpy from source.

First, install the LibRaw library on your system.

On Ubuntu, you can get (an outdated) version with:

sudo apt-get install libraw-dev

Or install the latest release version from the source repository:

git clone https://github.com/LibRaw/LibRaw.git libraw
git clone https://github.com/LibRaw/LibRaw-cmake.git libraw-cmake
cd libraw
git checkout 0.19.0
cp -R ../libraw-cmake/* .
cmake .
sudo make install

After that, install rawpy using pip install rawpy --no-binary rawpy.

If you get the error “ImportError: libraw.so: cannot open shared object file: No such file or directory” when trying to use rawpy, then do the following:

echo "/usr/local/lib" | sudo tee /etc/ld.so.conf.d/99local.conf
sudo ldconfig

The LibRaw library is installed in /usr/local/lib (if installed manually) and apparently this folder is not searched for libraries by default in some Linux distributions.

NumPy Dependency

rawpy depends on NumPy. The minimum supported NumPy version depends on your Python version:

Python

NumPy

2.7

>= 1.7

3.4

>= 1.8

3.5

>= 1.9

3.6

>= 1.11

Metadata

Release files for rawpy 0.12.0a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for rawpy 0.12.0a1
File
rawpy-0.12.0a1-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
rawpy-0.12.0a1-cp36-cp36m-win32.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-32 Details
rawpy-0.12.0a1-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details
rawpy-0.12.0a1-cp36-cp36m-macosx_10_10_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.10+ x86-64 Details
rawpy-0.12.0a1-cp35-cp35m-win_amd64.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-64 Details
rawpy-0.12.0a1-cp35-cp35m-win32.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-32 Details
rawpy-0.12.0a1-cp35-cp35m-manylinux1_x86_64.whl CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64 Details
rawpy-0.12.0a1-cp35-cp35m-macosx_10_10_x86_64.whl CPython 3.5 CPython 3.5 pymalloc macOS 10.10+ x86-64 Details
rawpy-0.12.0a1-cp34-cp34m-win_amd64.whl CPython 3.4 CPython 3.4 pymalloc Windows x86-64 Details
rawpy-0.12.0a1-cp34-cp34m-win32.whl CPython 3.4 CPython 3.4 pymalloc Windows x86-32 Details
rawpy-0.12.0a1-cp34-cp34m-manylinux1_x86_64.whl CPython 3.4 CPython 3.4 pymalloc Linux glibc 2.5+ x86-64 Details
rawpy-0.12.0a1-cp34-cp34m-macosx_10_10_x86_64.whl CPython 3.4 CPython 3.4 pymalloc macOS 10.10+ x86-64 Details
rawpy-0.12.0a1-cp27-cp27mu-manylinux1_x86_64.whl CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-64 Details
rawpy-0.12.0a1-cp27-cp27m-win_amd64.whl CPython 2.7 CPython 2.7 pymalloc Windows x86-64 Details
rawpy-0.12.0a1-cp27-cp27m-win32.whl CPython 2.7 CPython 2.7 pymalloc Windows x86-32 Details
rawpy-0.12.0a1-cp27-cp27m-macosx_10_10_x86_64.whl CPython 2.7 CPython 2.7 pymalloc macOS 10.10+ x86-64 Details

Total release size: 8.2 MB

Release files / rawpy-0.12.0a1-cp36-cp36m-win_amd64.whl

Download URL rawpy-0.12.0a1-cp36-cp36m-win_amd64.whl
Size 531.8 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
a0f73861fed0aaf5d846cd71c0fccc86ba0d6899744ba8d69d92342245d2c137
BLAKE2b-256 checksum
How to use checksums
e26317db58c11f2d8741d7e8862f0df33fd8e8573201e7315bf66aa058954955
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rawpy-0.12.0a1-cp36-cp36m-win32.whl

Download URL rawpy-0.12.0a1-cp36-cp36m-win32.whl
Size 462.3 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
622b743e6de75f18999acc22aafdaeb2b41b7b15b8b4a5bea48949458a194994
BLAKE2b-256 checksum
How to use checksums
113042adc450bbe65df6e6c34e377b20ced2017094019f2b29f74bd938f18af6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rawpy-0.12.0a1-cp36-cp36m-manylinux1_x86_64.whl

Download URL rawpy-0.12.0a1-cp36-cp36m-manylinux1_x86_64.whl
Size 675.8 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
c7d64447bdeb8871921e1cf42d1ee3d76f13d946bb6f931742e397af5ac5de72
BLAKE2b-256 checksum
How to use checksums
f52139e7141e2600e4fcc8a18d7483dbea58ba662e3d3769bb7fbe7e864c7337
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rawpy-0.12.0a1-cp36-cp36m-macosx_10_10_x86_64.whl

Download URL rawpy-0.12.0a1-cp36-cp36m-macosx_10_10_x86_64.whl
Size 526.1 kB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.10+ x86-64
SHA-256 checksum
How to use checksums
0529213e7f886b503fe753839eb9fe41680602e779cae15af1f540c9a3d60aee
BLAKE2b-256 checksum
How to use checksums
98498bdf5ad72db256b2857b1d815728089e22402b9ee97eb6bec6c4b1740b10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rawpy-0.12.0a1-cp35-cp35m-win_amd64.whl

Download URL rawpy-0.12.0a1-cp35-cp35m-win_amd64.whl
Size 530.6 kB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
e79fcde20750743f3bd5ad703293b09869d891053a570e56a8cce4e8bf3d35a1
BLAKE2b-256 checksum
How to use checksums
3ba3045045c5c83a4466be1ff245fc62e9f264da684c69b97488a77dc2cd6a61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rawpy-0.12.0a1-cp35-cp35m-win32.whl

Download URL rawpy-0.12.0a1-cp35-cp35m-win32.whl
Size 461.6 kB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
a80bca03eedcd1ec307f4f31a6d16c97e46ecbf4075c030455bf9c6566ba38bc
BLAKE2b-256 checksum
How to use checksums
d0696ae00036dde6f2aca909b742d3d49765de165c65906e26f949ac65b6405c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rawpy-0.12.0a1-cp35-cp35m-manylinux1_x86_64.whl

Download URL rawpy-0.12.0a1-cp35-cp35m-manylinux1_x86_64.whl
Size 667.5 kB
Tags CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
80518e78c54ecd541e3ea67d27d1d22b4b000de3b978f686fc2a15366ec6321a
BLAKE2b-256 checksum
How to use checksums
9c4eebad841e0b6f6fca37330c4dc94e95b2452358be77c0d12703e00a4b82bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rawpy-0.12.0a1-cp35-cp35m-macosx_10_10_x86_64.whl

Download URL rawpy-0.12.0a1-cp35-cp35m-macosx_10_10_x86_64.whl
Size 525.1 kB
Tags CPython 3.5 CPython 3.5 pymalloc macOS 10.10+ x86-64
SHA-256 checksum
How to use checksums
e0aad785d26b5e3dd988dcb2667b1231f8df63f8b52dcf304c40ad6c3749a8db
BLAKE2b-256 checksum
How to use checksums
3866b58ef9bd6e614653437e060842aead0321cb6c0ba0c8e678e1658f5cc687
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rawpy-0.12.0a1-cp34-cp34m-win_amd64.whl

Download URL rawpy-0.12.0a1-cp34-cp34m-win_amd64.whl
Size 369.1 kB
Tags CPython 3.4 CPython 3.4 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
76db80743335c6c3ca1d6d5d450955b7d03960d075c5fa8c0d594a5d42e78ebb
BLAKE2b-256 checksum
How to use checksums
f40531292f802b70cd9d25911a658137c945f1bdfe0ff25c7a3f48ac8680f622
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rawpy-0.12.0a1-cp34-cp34m-win32.whl

Download URL rawpy-0.12.0a1-cp34-cp34m-win32.whl
Size 332.9 kB
Tags CPython 3.4 CPython 3.4 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
b2a173300d98f2f1902fb733b42864c4ab467eebefaa47035c0a730c1d8c8de7
BLAKE2b-256 checksum
How to use checksums
91395fa33c9f879d9310a38eefb03315b5fc0fcb6d2e5cecfcc62ee4acb8f483
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rawpy-0.12.0a1-cp34-cp34m-manylinux1_x86_64.whl

Download URL rawpy-0.12.0a1-cp34-cp34m-manylinux1_x86_64.whl
Size 670.8 kB
Tags CPython 3.4 CPython 3.4 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
02032ec34473b9ef21ddb4bdc5fbb6e953c2d9a25e9309fe1dd456dbb06f6959
BLAKE2b-256 checksum
How to use checksums
aa96d1e5e15cedb15deade3b2ed88840332a23308a29f77995a29f17ad7309d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rawpy-0.12.0a1-cp34-cp34m-macosx_10_10_x86_64.whl

Download URL rawpy-0.12.0a1-cp34-cp34m-macosx_10_10_x86_64.whl
Size 524.8 kB
Tags CPython 3.4 CPython 3.4 pymalloc macOS 10.10+ x86-64
SHA-256 checksum
How to use checksums
e110674fc0db19f81794025e47923cfe270d9ba218dee057285a47cf6a8beb6e
BLAKE2b-256 checksum
How to use checksums
56010c1f71bba2a21bac6035d79ec0f9a762887c16f5c1ba3be084e0913ae44a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rawpy-0.12.0a1-cp27-cp27mu-manylinux1_x86_64.whl

Download URL rawpy-0.12.0a1-cp27-cp27mu-manylinux1_x86_64.whl
Size 646.8 kB
Tags CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
cd37ecff8219c5ec1e75945e894865bd1e310fa65af6382152633f594d311081
BLAKE2b-256 checksum
How to use checksums
8d3d612ddc60e0c2018095df16c8718880cd3085ad29b0830fd9ff58cebf2cac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rawpy-0.12.0a1-cp27-cp27m-win_amd64.whl

Download URL rawpy-0.12.0a1-cp27-cp27m-win_amd64.whl
Size 397.3 kB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
65e3369bc4e6a7af6bf912547b3270c15d5c907ed988db3c62db169378aca134
BLAKE2b-256 checksum
How to use checksums
24eddcec5a0018f5f71a5b7304468f7c71daf347398acf1694cd002505614bc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rawpy-0.12.0a1-cp27-cp27m-win32.whl

Download URL rawpy-0.12.0a1-cp27-cp27m-win32.whl
Size 355.0 kB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
71f73f30ffcd782c1fa105f8f10df8bc44497bd8af1a2c92da40ec209bb9e3c3
BLAKE2b-256 checksum
How to use checksums
65dc5db53dfcc801fbca550085509d96a0fd46c0a1775f7b41c2952ced912933
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / rawpy-0.12.0a1-cp27-cp27m-macosx_10_10_x86_64.whl

Download URL rawpy-0.12.0a1-cp27-cp27m-macosx_10_10_x86_64.whl
Size 525.7 kB
Tags CPython 2.7 CPython 2.7 pymalloc macOS 10.10+ x86-64
SHA-256 checksum
How to use checksums
358935856995a603a83ce490c23335e408ffe8b3e98a4858f67e3a214f3d19df
BLAKE2b-256 checksum
How to use checksums
7659b0554241287d66082cbc99880b698a8db11b2395807a9a8a9a8a1fb8eac6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.12.0a1 This release

16 release files

0.9.0

12 release files

0.8.1

9 release files

0.8.0

9 release files

0.6.0

12 release files

0.5.1

12 release files

0.4.0

9 release files

0.3.5

9 release files

0.3.4

9 release files

0.3.3

9 release files

0.3.2

6 release files

0.3.1

9 release files

0.3.0

9 release files

0.2.0

7 release files

0.1.0

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page