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'
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

rawpy-0.4.0-cp34-none-win_amd64.whl (476.8 kB view details)

Uploaded CPython 3.4Windows x86-64

rawpy-0.4.0-cp34-none-win32.whl (435.9 kB view details)

Uploaded CPython 3.4Windows x86

rawpy-0.4.0-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (859.4 kB view details)

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

rawpy-0.4.0-cp33-none-win_amd64.whl (476.8 kB view details)

Uploaded CPython 3.3Windows x86-64

rawpy-0.4.0-cp33-none-win32.whl (435.9 kB view details)

Uploaded CPython 3.3Windows x86

rawpy-0.4.0-cp33-cp33m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (858.6 kB view details)

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

rawpy-0.4.0-cp27-none-win_amd64.whl (503.9 kB view details)

Uploaded CPython 2.7Windows x86-64

rawpy-0.4.0-cp27-none-win32.whl (458.8 kB view details)

Uploaded CPython 2.7Windows x86

rawpy-0.4.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (859.5 kB view details)

Uploaded CPython 2.7macOS 10.10+ Intel (x86-64, i386)macOS 10.10+ x86-64macOS 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.4.0-cp34-none-win_amd64.whl.

File metadata

File hashes

Hashes for rawpy-0.4.0-cp34-none-win_amd64.whl
Algorithm Hash digest
SHA256 ca0bfc3eb410b9208af02e76fa7e59b9ad073bb9094cf88d5dc021fe3b019aeb
MD5 12987b02ca324d75615028bd0bfc8459
BLAKE2b-256 9b00701a0e1264c565e05ddb273ca39a2acab04d07497c48cef3ffafc7ad3c0d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.4.0-cp34-none-win32.whl
Algorithm Hash digest
SHA256 a7a169e3e19422a08cfcf7aa183e6f3423abfb45a0d9a7da47ab3517bc16f936
MD5 fe5ffa2096e4bbb0d1f896022db824ea
BLAKE2b-256 d221d1e06985e57addb7c2354eced860a90b95e5d2160081a2c36b43f97678e0

See more details on using hashes here.

File details

Details for the file rawpy-0.4.0-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for rawpy-0.4.0-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 e68c9697bf5c3c23249da04114ca424c9b5ac2efd86d5838b21522ef6b0c5726
MD5 57a4433a8da951200b5af56977e991db
BLAKE2b-256 edd2792da270263e5997dd7185688e86fa844d66c520504805a6c19b1a17715f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.4.0-cp33-none-win_amd64.whl
Algorithm Hash digest
SHA256 843cb55c3c0b705eda307071bce104a5988dedcdd113cbf5d6d198baa3a8df21
MD5 c81925a6fafd951d37f0988b38a42575
BLAKE2b-256 1697eb1d2b829950f8b162a314233210de8ffadde5898c7de0d96e870991d6b7

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.4.0-cp33-none-win32.whl
Algorithm Hash digest
SHA256 71f9392181f06042a0db39e6ed30d7a8a67f513e1f54784273004ab4244630ad
MD5 0a982d8dc0dd2c174773ffb1350d5a45
BLAKE2b-256 3f75b7ee78df740141b60b3228b268ef36f5cdac1d8186675b9a38a0b4ae352f

See more details on using hashes here.

File details

Details for the file rawpy-0.4.0-cp33-cp33m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for rawpy-0.4.0-cp33-cp33m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 6e4970b6532f97a2a89dad715602bdf8a96a78b74f8a70b064826093585da5d2
MD5 02d72b6451aabcd95df8128dd7831a44
BLAKE2b-256 142168957207a80e2876402feeff1c3a0a00abe421b84f34a1a5a3a5794d3e54

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.4.0-cp27-none-win_amd64.whl
Algorithm Hash digest
SHA256 ce6cdf91a4b219b83808c7baa758a4f20ccba508579821904a26cc69b2e46fc2
MD5 eb5d652c9fa8e0c2e8b1128ecd16c109
BLAKE2b-256 ca80160af30375ea94e9502667671c01c6001910259a3c2a154b182246c5cbfc

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.4.0-cp27-none-win32.whl
Algorithm Hash digest
SHA256 98184142f5e04aa3a13a80c2bf8854ba8967778a222a57009047b6fdbfdc8a7e
MD5 c7016269b5d67a908dd58276cd4b1670
BLAKE2b-256 0d61f069892411c92ed540b3155d31ef9b94486e9be38fb72d4cd36d565fceee

See more details on using hashes here.

File details

Details for the file rawpy-0.4.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl.

File metadata

File hashes

Hashes for rawpy-0.4.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Algorithm Hash digest
SHA256 5a2b3ea236a8759d7db6183a3794427738f6c1f71366f27fdd47d4be71b6d4d0
MD5 3d9708f1828758e2e79c55d52af936d1
BLAKE2b-256 ce6fd99ca6966240db870ff02f8b574ebcb619b0af88383ca89c7c0069ffdc0e

See more details on using hashes here.

Supported by

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