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.0-cp36-cp36m-win_amd64.whl (520.4 kB view details)

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mWindows x86

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

Uploaded CPython 3.6m

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

Uploaded CPython 3.6mmacOS 10.10+ x86-64

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.5mWindows x86

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

Uploaded CPython 3.5m

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

Uploaded CPython 3.5mmacOS 10.10+ x86-64

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

Uploaded CPython 3.4mWindows x86-64

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

Uploaded CPython 3.4mWindows x86

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

Uploaded CPython 3.4m

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

Uploaded CPython 3.4mmacOS 10.10+ x86-64

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mWindows x86-64

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

Uploaded CPython 2.7mWindows x86

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

Uploaded CPython 2.7mmacOS 10.10+ x86-64

File details

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

File metadata

File hashes

Hashes for rawpy-0.10.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 1199e379fea45028a88e078e99400f482745c6e1e1d9113edfc727bdf2002b59
MD5 231534f425f36dacf31a25147b6b7d81
BLAKE2b-256 8417ef7cf46723ee297f0a3de5d1172b9ee5b3ce1c6af46fca1e11ddd88783ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.10.0-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 8b62e39aa73d44190299fa88d9125ba7c5dbe099f1cdecdb946c0e655296bba8
MD5 e648f3c5ea44229e2fa62cf575a9d8dd
BLAKE2b-256 df81eddbf476330b234168885b9c89c108eccbe152b55fdec45c68fa32253358

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.10.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 54eb2c4aadb6901b4117ab15ef11e66705a520ed4f1d97784c2fdae37a21e8f9
MD5 e05b0a826e6f7a706de8aaa016adeee0
BLAKE2b-256 d2b3aeaf27a84fdcf8549eb56195bcaf2946a6d64e38d1ac6cca45b6918ea0ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.10.0-cp36-cp36m-macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 3f8bfad898eff30443a8074c52b42b78e1dca839ce2ed735590b95ad271d0805
MD5 57901dab42bbc94591fb877de3db7462
BLAKE2b-256 727a64219d838e2630941b8241c4df0346632ba09ab1615770ea24050c7dad5a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.10.0-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 c70cce8fe303448de762ad1ba6d6935889a9d08e436861736d42dc77a34ac964
MD5 1a2de85e25d563438e85dc6cdae260b7
BLAKE2b-256 201b7ad42636cbad4752e9e93b8728985a3d5cc98e846eefc2085ca3131bf47f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.10.0-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 1777c1981b3d112fe88c9855ef695c1fa338ddb300bd6e30edfbdc984afe6fb0
MD5 7b42be22a533b5c8671abcabc6b5e6d3
BLAKE2b-256 9b56527c3e0028f0cf8026446a50dbb728a5a0de52f99d30903aaedfddd2eb0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.10.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a8910ce178a31885a682bd3de56f90e6863f7bf3e8f08b9b6f25967b86c56cd8
MD5 9f97658b684b1b8f769223397c1c6f6a
BLAKE2b-256 6a4c1b18fcf8eec88f0ff00343b77330828a4f7e961f0e9ad70085df72bf9511

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.10.0-cp35-cp35m-macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 75ae5462dace28cc2081086164a2f16c69909b37237076b7f41faa61364ad83e
MD5 b3f91b53f25fd40eec88d99412927e04
BLAKE2b-256 64e20cd1c918e837b108a9cf6aca0bacdf2414bdc7604606f7e4b176699aa9c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.10.0-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 2de9f1c7472acc4439cfe0af713439f34ede7f950285bb7c3b212aaa6c5568ea
MD5 cafcf0ea6bd27b8f118b5d37f9ba7ab3
BLAKE2b-256 8215eb07153bc2408b323c51fb9be2e4b3f0a05062a58b4850e73b6025e4f7bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.10.0-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 e12791264e0e55782ed8291e1597c8e263553a861e0f57cc7bdab4a177818ed2
MD5 d7e9ef3f4eef67dfc0162745aa69a332
BLAKE2b-256 d7861d50b7531200dc6364c4485849fa63d6965acf46a55eb3ed6a5d3821c8a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.10.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b11c02618344bdd6e82eb8ada173c21cffe4b33859225971149763ee56360db2
MD5 824d71eb7395ee537a1b64ce7510d2a1
BLAKE2b-256 bc7a4ef75961a1577231dd1bb9640446c519660206d5b54ed2f780486d2d9c68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.10.0-cp34-cp34m-macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 a28cca7fcced128ebfb67e8d9f64f49cafbc97f09a6faa5f30bfede2cd3bda87
MD5 78723677b7da7290ba13d573861c84b1
BLAKE2b-256 d84e3202baadba7972e7327045812685581e10a14145ebc0d05b0380a351938e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.10.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 dffecc7f8754ee931fb96342d4937140f3754524df9eaff84650ed430d4ceb39
MD5 619449f1a4ed8a7f5dcafb0b85fcc68b
BLAKE2b-256 e905d40c2dcd84bb0057d9a42e1127834de39b4c94a6215334748f0770eec4fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.10.0-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 2953a229fa94f6b1321c31636f7208f15400b8aec8ed616c6b14acf1691bcfa2
MD5 c0e035af895ac3e2ff004eb58f602c4e
BLAKE2b-256 cdca06d1946224fb4a3b131cfb45b98b24477d6cc25ab16d06f86939e9069e5c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.10.0-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 1d3224bd7f545cbd49d55557214816a1c76b91747ba7dfcb980da770579be6b7
MD5 678e840c05e3049d7302fcb8772da3d2
BLAKE2b-256 c9fd0e780674241d32f127659ea37fa66efbdb7438b09fc3d41f6b3b71bfb53e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.10.0-cp27-cp27m-macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 a21eab320d42267a27d3545da2514cb8986dcbd42f42295ecd556c4d51a26429
MD5 24ccda44ceaa9ff1f27d895bae64c3de
BLAKE2b-256 2d60434322345b613dbf26a3c8f32c4c8d5113a5b25c8d774eb47aba4d65aeea

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