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.findBadPixels(paths)

for path in paths:
    raw = rawpy.imread(path)
    rawpy.enhance.repairBadPixels(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
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.2.0-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.2.0-cp33-none-win_amd64.whl (447.6 kB view details)

Uploaded CPython 3.3Windows x86-64

rawpy-0.2.0-cp33-none-win32.whl (406.9 kB view details)

Uploaded CPython 3.3Windows x86

rawpy-0.2.0-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.2.0-cp27-none-win_amd64.whl (472.3 kB view details)

Uploaded CPython 2.7Windows x86-64

rawpy-0.2.0-cp27-none-win32.whl (430.3 kB view details)

Uploaded CPython 2.7Windows x86

rawpy-0.2.0-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.2.0-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for rawpy-0.2.0-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 99ff1756612c0a50719a49770c41c83997676d50a2902845652e5b30867623fc
MD5 db2e93a3f6e02b046127c6e0db4e1823
BLAKE2b-256 8ea55b69c92024b0a49bd0c812e9ad40f2779a713eff3c88fa186515fcf20b2f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.2.0-cp33-none-win_amd64.whl
Algorithm Hash digest
SHA256 90cb6b87d1effb54af06ca33b7bd1251b2ce18fec148409cd335bbc57818a0e8
MD5 4bdaf4c97c9fa49493b26c8a417abd85
BLAKE2b-256 b30748fafc0f4fbfd0e9fb73f521bf10a8b43f053d397391cd27c05a39af5926

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.2.0-cp33-none-win32.whl
Algorithm Hash digest
SHA256 2de9215a991dbe12bd96fb925160e6d892474efc4e5eb4998c707893ff47fa4a
MD5 b0a7f238628dcd48c6569e2204240c4c
BLAKE2b-256 3dda3d63ad59e0600c79e229a707fe2f3a356162ab07975d6e5ab013dfab061f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.2.0-cp33-cp33m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1cd98a6df2385df7f7c2d2bf07d4e876044d9dfcbacadf8c8f4bc9b65f916fe5
MD5 65979e06886b2c3d17b56dea689163db
BLAKE2b-256 963ff94f21786d9383291f7d5a52f7b38f2ee9edb364bd7a4bb529c2539a571c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.2.0-cp27-none-win_amd64.whl
Algorithm Hash digest
SHA256 84c13c0e9a4734fe85af9d120959d31481b8a5a60b6eb5c3a36ebd2a19848058
MD5 8980e9f6a93990098f0e13f52f31643b
BLAKE2b-256 a27eadecbe2d4f20d499978f574ff3bbd4e643cf9a8d4b02518e3639d87fb3b0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.2.0-cp27-none-win32.whl
Algorithm Hash digest
SHA256 25238c5fb3c0117a4b517a43fe25916daae2b4fec1eec28f0eda0784d99f7446
MD5 2f64892c9e8fd6584555760dc861fb98
BLAKE2b-256 28165230a037bc10c501f3dc38de0b0ad09926a1cc98aadaea325ec12f8024a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.2.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a4d51966390d1422a74c0648dc9188576851cd02460289329862a02f455d74cc
MD5 53ce16483434ca49d0510043db3d3508
BLAKE2b-256 dcae6ec036469a14183a7c5b36f46d1231443a188e3138506df81007c46d3a98

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