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.

Sample code

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

import rawpy
import imageio

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

Save as 16-bit linear image:

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:
    raw = rawpy.imread(path)
    rawpy.enhance.repair_bad_pixels(raw, bad_pixels, method='median')
    rgb = raw.postprocess()
    imageio.imsave(path + '.tiff', rgb)

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 developer version from the SVN repository:

git clone git://github.com/LibRaw/LibRaw.git libraw
git clone git://github.com/LibRaw/LibRaw-cmake.git libraw-cmake
cp -R libraw-cmake/* libraw ;
cd libraw
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 and apparently this folder is not searched for libraries by default in some Linux distributions.

Installation on Windows and Mac OS X

Binaries are provided for Python 2.7, 3.3 and 3.4 for both 32 and 64 bit. These can be installed with a simple pip install --use-wheel rawpy (or just pip install rawpy if using pip >= 1.5).

Binaries for other Python versions are currently not produced but if there is a need then this is possible as well. In that case, just contact me.

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.3.1-cp34-none-win_amd64.whl (447.6 kB view details)

Uploaded CPython 3.4Windows x86-64

rawpy-0.3.1-cp34-none-win32.whl (407.0 kB view details)

Uploaded CPython 3.4Windows x86

rawpy-0.3.1-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl (788.3 kB view details)

Uploaded CPython 3.4mmacOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

rawpy-0.3.1-cp33-none-win_amd64.whl (447.6 kB view details)

Uploaded CPython 3.3Windows x86-64

rawpy-0.3.1-cp33-none-win32.whl (407.0 kB view details)

Uploaded CPython 3.3Windows x86

rawpy-0.3.1-cp33-cp33m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl (788.1 kB view details)

Uploaded CPython 3.3mmacOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

rawpy-0.3.1-cp27-none-win_amd64.whl (472.3 kB view details)

Uploaded CPython 2.7Windows x86-64

rawpy-0.3.1-cp27-none-win32.whl (430.4 kB view details)

Uploaded CPython 2.7Windows x86

rawpy-0.3.1-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl (789.0 kB view details)

Uploaded CPython 2.7macOS 10.6+ Intel (x86-64, i386)macOS 10.9+ Intel (x86-64, i386)macOS 10.9+ x86-64

File details

Details for the file rawpy-0.3.1-cp34-none-win_amd64.whl.

File metadata

File hashes

Hashes for rawpy-0.3.1-cp34-none-win_amd64.whl
Algorithm Hash digest
SHA256 1b3f55275081193706ac5d0669d8208db21f25722f51b1b85c4e33646c781540
MD5 39edf19265607dbb9b9371a60714e271
BLAKE2b-256 d71e6578b03b407214f0317218576636b4980540f786cb6d20c5ea1b358b2527

See more details on using hashes here.

File details

Details for the file rawpy-0.3.1-cp34-none-win32.whl.

File metadata

  • Download URL: rawpy-0.3.1-cp34-none-win32.whl
  • Upload date:
  • Size: 407.0 kB
  • Tags: CPython 3.4, Windows x86
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rawpy-0.3.1-cp34-none-win32.whl
Algorithm Hash digest
SHA256 036cb2d4fd2b277bf27bf959b3441973d9fbda6e87a97b9e96cad1d9f0fe7373
MD5 5a28c2d6f6f3ee6794d163f7a460a8d1
BLAKE2b-256 9096d56460888edcc315ecabb7eb5d1c6da4b09985f4e6b289bb014e55630aa8

See more details on using hashes here.

File details

Details for the file rawpy-0.3.1-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for rawpy-0.3.1-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5cdbf114a79bd54db6993dddd8e5dc8ef1072e6c2130341452be989d0d4a50d5
MD5 0d7f9368f2735164d5ac802683161631
BLAKE2b-256 a28a3199ce9784b4a4e1c0fffd263e91353ded4b294fe06cc33bda7964f15804

See more details on using hashes here.

File details

Details for the file rawpy-0.3.1-cp33-none-win_amd64.whl.

File metadata

File hashes

Hashes for rawpy-0.3.1-cp33-none-win_amd64.whl
Algorithm Hash digest
SHA256 59acc6c304a702b247de2c44c2fc8fe34a8f5d79d9ac569d7678e0329df217e3
MD5 c0dfd749a2033d2c33ad79968c9ab190
BLAKE2b-256 8abe74209d73e0b7ff29d724a07ba39f2aad2f8fdbc3ea2622d83b307290c3c9

See more details on using hashes here.

File details

Details for the file rawpy-0.3.1-cp33-none-win32.whl.

File metadata

  • Download URL: rawpy-0.3.1-cp33-none-win32.whl
  • Upload date:
  • Size: 407.0 kB
  • Tags: CPython 3.3, Windows x86
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rawpy-0.3.1-cp33-none-win32.whl
Algorithm Hash digest
SHA256 a38de80035ff9c55f0630a41c3c10616e0a9089806c92cb9ae11e445f3e8cc92
MD5 13b10126ed6e696af0536f76f1877ca3
BLAKE2b-256 57c0a6d305e3abfdedd00668d673a72ad065cda9297182d179f0db33914f1c88

See more details on using hashes here.

File details

Details for the file rawpy-0.3.1-cp33-cp33m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for rawpy-0.3.1-cp33-cp33m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e129096a11337cd66d6fa299e853addc959a9e3c3072e82f87614c920e6a8365
MD5 713907a45021720f8f6f10b4296e554b
BLAKE2b-256 7883c039de5d68388a4990c50ba5b2e4b457655fc524be7fa2074ec8e5b8c711

See more details on using hashes here.

File details

Details for the file rawpy-0.3.1-cp27-none-win_amd64.whl.

File metadata

File hashes

Hashes for rawpy-0.3.1-cp27-none-win_amd64.whl
Algorithm Hash digest
SHA256 9f646c9f743a676478ebb020b7a2726cc1b31e6ef7c0ae06279f74251912ea3d
MD5 837423023170b362ce0e2b09a17a9780
BLAKE2b-256 64b039c2908a81feeaedd4b1fd0cb992704f4f958acea1dedcbd48b8943c70e8

See more details on using hashes here.

File details

Details for the file rawpy-0.3.1-cp27-none-win32.whl.

File metadata

  • Download URL: rawpy-0.3.1-cp27-none-win32.whl
  • Upload date:
  • Size: 430.4 kB
  • Tags: CPython 2.7, Windows x86
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rawpy-0.3.1-cp27-none-win32.whl
Algorithm Hash digest
SHA256 d8cf6338d5fd8d4ffe135a95fa7dd99b94a24e8cc4515f2fe63c82267ba6ebfc
MD5 af05598c5deef611a1b79f36accae41f
BLAKE2b-256 0ddf66fc60181aa729a42a310d7ba8d46df376b84f00961972e7dc28267ee5d2

See more details on using hashes here.

File details

Details for the file rawpy-0.3.1-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for rawpy-0.3.1-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 327040781bb23feb9bd3c492385c031d794e81ad8ce601c358a6d81942d3823d
MD5 84ed12b995870eeeeba31818a42228db
BLAKE2b-256 1b58302904919afc03dd59b6cd5e73b246656a474c5ccacc41eba1b130554c54

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