Skip to main content

Python wrapper for the LibRaw library

Project description

Linux Build Status Mac OS X 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

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 on Windows and macOS

Binaries are provided for Python 2.7, 3.4, 3.5, and 3.6. These can be installed with a simple pip install rawpy (or pip install --use-wheel rawpy if using pip < 1.5).

Installation on Linux

You need to have the LibRaw library installed to use this wrapper.

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.18.2
cp -R ../libraw-cmake/* .
cmake .
sudo make install

After that, it’s the usual pip install 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rawpy-0.10.0a1-cp36-cp36m-win_amd64.whl (518.8 kB view details)

Uploaded CPython 3.6mWindows x86-64

rawpy-0.10.0a1-cp36-cp36m-win32.whl (450.1 kB view details)

Uploaded CPython 3.6mWindows x86

rawpy-0.10.0a1-cp36-cp36m-manylinux1_x86_64.whl (647.6 kB view details)

Uploaded CPython 3.6m

rawpy-0.10.0a1-cp36-cp36m-macosx_10_10_x86_64.whl (506.9 kB view details)

Uploaded CPython 3.6mmacOS 10.10+ x86-64

rawpy-0.10.0a1-cp35-cp35m-win_amd64.whl (517.9 kB view details)

Uploaded CPython 3.5mWindows x86-64

rawpy-0.10.0a1-cp35-cp35m-win32.whl (449.3 kB view details)

Uploaded CPython 3.5mWindows x86

rawpy-0.10.0a1-cp35-cp35m-manylinux1_x86_64.whl (639.0 kB view details)

Uploaded CPython 3.5m

rawpy-0.10.0a1-cp35-cp35m-macosx_10_10_x86_64.whl (505.6 kB view details)

Uploaded CPython 3.5mmacOS 10.10+ x86-64

rawpy-0.10.0a1-cp34-cp34m-win_amd64.whl (356.8 kB view details)

Uploaded CPython 3.4mWindows x86-64

rawpy-0.10.0a1-cp34-cp34m-win32.whl (318.4 kB view details)

Uploaded CPython 3.4mWindows x86

rawpy-0.10.0a1-cp34-cp34m-manylinux1_x86_64.whl (644.6 kB view details)

Uploaded CPython 3.4m

rawpy-0.10.0a1-cp34-cp34m-macosx_10_10_x86_64.whl (505.8 kB view details)

Uploaded CPython 3.4mmacOS 10.10+ x86-64

rawpy-0.10.0a1-cp27-cp27mu-manylinux1_x86_64.whl (611.6 kB view details)

Uploaded CPython 2.7mu

rawpy-0.10.0a1-cp27-cp27m-win_amd64.whl (383.7 kB view details)

Uploaded CPython 2.7mWindows x86-64

rawpy-0.10.0a1-cp27-cp27m-win32.whl (341.2 kB view details)

Uploaded CPython 2.7mWindows x86

rawpy-0.10.0a1-cp27-cp27m-macosx_10_10_x86_64.whl (506.0 kB view details)

Uploaded CPython 2.7mmacOS 10.10+ x86-64

File details

Details for the file rawpy-0.10.0a1-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for rawpy-0.10.0a1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 6fe5a880f34d48348f890a80e628eef937b8815904926c48f53e76a0c77ca0dc
MD5 43716895d2d52b3575c66b2365e79c28
BLAKE2b-256 165a4cfd9e60d7afdaa58d9408dddd648cd4daafa58e82d33d2dde64904d4097

See more details on using hashes here.

File details

Details for the file rawpy-0.10.0a1-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for rawpy-0.10.0a1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 4714a5af223f9cafd2356113b6ffc2a52ac5779037d2eb6db5446a70136e8875
MD5 cb976959ea306f92969ba0418404af85
BLAKE2b-256 6f6e4acd3574ed87a015d2ba71a2c0c883042b8ad7b858fd1cc3701cb41f6e74

See more details on using hashes here.

File details

Details for the file rawpy-0.10.0a1-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for rawpy-0.10.0a1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7bd25ea80d51bf1b19eaa12cad15f97eeb69c9d251afe169c5bc621817d0fd53
MD5 8f9f4745f29f91a7b3cd90da70c83c49
BLAKE2b-256 ca76be8db22633d5f015aaa29b51f9871afd0023494e194a7d6d616d5195dd48

See more details on using hashes here.

File details

Details for the file rawpy-0.10.0a1-cp36-cp36m-macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for rawpy-0.10.0a1-cp36-cp36m-macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 d7e48234c726af7f3dbd9cac29f5d8d383da7f965c7ed71a9cf7f2711982d123
MD5 21a2e3f7c5f31da9386b286fad67b551
BLAKE2b-256 e2474b415a503bf62420b0f602e8d8696b898be6e03c8e601acf29353b34ba1d

See more details on using hashes here.

File details

Details for the file rawpy-0.10.0a1-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for rawpy-0.10.0a1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 1fa4e0497b86bdde3a600349fb00c75ea8c7d1f70588b766384058dfd101bf3b
MD5 dd2d8b315e2cc8bb5efba9ef40d083bc
BLAKE2b-256 302929ccb5f23c660eb3ef5b709f1028fdd09e6c464683a588b0c9189a49ef9f

See more details on using hashes here.

File details

Details for the file rawpy-0.10.0a1-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for rawpy-0.10.0a1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 703aba1dacac2f8b5ee88718c4590c5ee3b737edc144992d24720937e971aee5
MD5 22ad037a8ba8e01f0e788c8008afce3d
BLAKE2b-256 cf2f843c987a7b7896544205cf9f3af8d20247cb62266dc6c0be8b9238ee7253

See more details on using hashes here.

File details

Details for the file rawpy-0.10.0a1-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for rawpy-0.10.0a1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8e7e6e1699ba4e79de23ae642552c61940450917c668fe8fd4444afaa5f3b735
MD5 6dee8bf80a5e08b8149a71304b3e3bcc
BLAKE2b-256 b7946eec76ec0497ac6ce75698e68b374a641f46af42cc0e452bdfe5f6583bdc

See more details on using hashes here.

File details

Details for the file rawpy-0.10.0a1-cp35-cp35m-macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for rawpy-0.10.0a1-cp35-cp35m-macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 51ecd56148e541004000677fbc5830cc019f8cfab56335d13bee267cbcdd2422
MD5 d9a6124099defa89c4b911935a773efb
BLAKE2b-256 89a6bb3df8a1e61ac95c818f0e52bbd8cb84d07db7a64046b90d7f79cc404562

See more details on using hashes here.

File details

Details for the file rawpy-0.10.0a1-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for rawpy-0.10.0a1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 094ecfdda585498473be36c4d7b8a57a6d14eb47e2f01fdcfefa709c53341711
MD5 c3de98eaf9f803f6c7a7e03dd5bb54af
BLAKE2b-256 105af979cef942a47074e6a49695790e025af5a2faee5d43ac5c431c90250c8d

See more details on using hashes here.

File details

Details for the file rawpy-0.10.0a1-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for rawpy-0.10.0a1-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 60b9a82d9012a4ee9c94a7976b94648a9d85f0f19c4afa6a09102ff2ae334b23
MD5 f728679a244decc6c92e4ce377b4023c
BLAKE2b-256 702457865074d36afdeaaf247880a20a1837db4a8e311eec39be258098489ad6

See more details on using hashes here.

File details

Details for the file rawpy-0.10.0a1-cp34-cp34m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for rawpy-0.10.0a1-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 27b87ac633902eb9dc0c8bb6352c702838229ad963c5515cf68497b56e9e27c7
MD5 ee5f67aac82811b9ed485cae06532322
BLAKE2b-256 7cba65ba429f877b4b6335b251005240cef1fde094430215181f337c7cae06aa

See more details on using hashes here.

File details

Details for the file rawpy-0.10.0a1-cp34-cp34m-macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for rawpy-0.10.0a1-cp34-cp34m-macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 58d5398a5e09bbf131b28379beb4beebaee8062ce83974aa9ffebb06c54c69fb
MD5 cb3034d316cbc643468819603b09ca1e
BLAKE2b-256 321a46814405d014168bf33ff491defad4f65f1da36fed76694d301143434e7b

See more details on using hashes here.

File details

Details for the file rawpy-0.10.0a1-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for rawpy-0.10.0a1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f9b09bb35f337eface58975b9ae05ed4fc58bf99b49ad69cba1cb258cb062b38
MD5 289688dce5dd31300f4e699e5b472ced
BLAKE2b-256 92740e70aced760db7aa5e6aa838d9fb63a875be37128aa4c4cb47f1e04af879

See more details on using hashes here.

File details

Details for the file rawpy-0.10.0a1-cp27-cp27m-win_amd64.whl.

File metadata

File hashes

Hashes for rawpy-0.10.0a1-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 b6f3926ded5b1bf924ab65de91de6fd0d1fa2f0c658b79032d4c870c54ff359a
MD5 8746c3b575b6ba82085c9755e56195a6
BLAKE2b-256 b8ab236ae1ad388fa1794dcd2f95d4da39b0234066848d8e1c9324e8dab6bd6f

See more details on using hashes here.

File details

Details for the file rawpy-0.10.0a1-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for rawpy-0.10.0a1-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 d078c584af7469c7f55559453f61e6f5428061a947bb69f26c97c2accc4a3b93
MD5 96e652e075f91e75a5460a0bb2e158ac
BLAKE2b-256 2a46bb18ae86a07004afe101c803b57f5662dcfd36b1466481af3461379518a6

See more details on using hashes here.

File details

Details for the file rawpy-0.10.0a1-cp27-cp27m-macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for rawpy-0.10.0a1-cp27-cp27m-macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 e690aec235c0a4231f835345ceee613a3039b685bcbffec3bd66da0ebe376949
MD5 cebb7d836345653262839c29c8c054d2
BLAKE2b-256 5a9c0ab5ce971964dda5601787077302a08c0574e825a561fec27d542eeddb54

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page