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

Uploaded CPython 3.4Windows x86-64

rawpy-0.3.5-cp34-none-win32.whl (407.6 kB view details)

Uploaded CPython 3.4Windows x86

rawpy-0.3.5-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 (787.7 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.3.5-cp33-none-win_amd64.whl (448.1 kB view details)

Uploaded CPython 3.3Windows x86-64

rawpy-0.3.5-cp33-none-win32.whl (407.6 kB view details)

Uploaded CPython 3.3Windows x86

rawpy-0.3.5-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 (786.9 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.3.5-cp27-none-win_amd64.whl (473.1 kB view details)

Uploaded CPython 2.7Windows x86-64

rawpy-0.3.5-cp27-none-win32.whl (430.9 kB view details)

Uploaded CPython 2.7Windows x86

rawpy-0.3.5-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 (787.8 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.3.5-cp34-none-win_amd64.whl.

File metadata

File hashes

Hashes for rawpy-0.3.5-cp34-none-win_amd64.whl
Algorithm Hash digest
SHA256 d3f4127dfdbda61153d99d278094bd1d98a8c4c2ac282aac8d60b1a8c1588568
MD5 01818fa12e1070a7c4d9684293094237
BLAKE2b-256 91c0a3fed6b7697edeb163f414d5c16278dde3ac049a1ff0e30f9744834148c7

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.3.5-cp34-none-win32.whl
Algorithm Hash digest
SHA256 ff60795bd598609eedba7054c584b5010c2e5e04e175f1cf613d6cab6abc770a
MD5 36dc6e2cf4d9502d55a8c14ca593db64
BLAKE2b-256 e82a9ea915fae60bc2f257e23915b57475cfc9f11c16e958d1e4257f1e878eb6

See more details on using hashes here.

File details

Details for the file rawpy-0.3.5-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.3.5-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 4c2e3b66a3edf77432c68477163a08a75af5390ba34b1b9828169f3b9f6c224a
MD5 8f7a9d3581e82b7e6069558591037d53
BLAKE2b-256 281736fe96c70c2d0a21b6e2153c01c1a09239c55e0e8ddc6aea6d3ab0a7e695

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.3.5-cp33-none-win_amd64.whl
Algorithm Hash digest
SHA256 cfe82017b0aef38f9368b34f64be230e05ad93a43544b9761dc3894e91e9b913
MD5 f58cc5a71ce00dbc1ee29894ff332c4e
BLAKE2b-256 7128672f88f829f0ca9595262c7f867139a04a76578b4060d856cff964d61101

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.3.5-cp33-none-win32.whl
Algorithm Hash digest
SHA256 9cad985123fb24b4c4594c30c79c1610620ec19148a3f73169624a1fc28969ba
MD5 5228cc1a539a13cd08933cab2c88cb36
BLAKE2b-256 df32ffe67741bf5b77d9705f367ecdeaa730ad6db66270dc3b008bc06e83495e

See more details on using hashes here.

File details

Details for the file rawpy-0.3.5-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.3.5-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 fd134102722a3627ad1820ebf03715fc1c82aa490896585c3efb1624ee19f6c4
MD5 9cbeebcdc770ffff452bed3f23864718
BLAKE2b-256 59e4017bb41e8ef73afa50546a6a1184140d02778b74bd7485753e0f64b597be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.3.5-cp27-none-win_amd64.whl
Algorithm Hash digest
SHA256 ef45eaad9a1031ff49a11761cd9399ff6b76e730df26141cd6fc7e0f1c70165c
MD5 9e951ae839a01a4f412aeda0c45c8435
BLAKE2b-256 6716929eee34eda3ce2dc4a3b544302d42995b087d96c9e4165c794a5764466b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.3.5-cp27-none-win32.whl
Algorithm Hash digest
SHA256 d61b479c75bb33d787350fb7256c0dcd93c8ce53e1ca5219fdc1d145e327d2ca
MD5 da83b479bde1a012df63148bb7bfee90
BLAKE2b-256 b63a2ed79c6123e317a2226008fd94b61937cc7b51aee6b8466a93405a89eeef

See more details on using hashes here.

File details

Details for the file rawpy-0.3.5-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.3.5-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 f62898b301b665b316650c56b854dd0e8084974730dc49a2df0fc1b9e6732105
MD5 f790f9f5de289f38607321083ad3b51b
BLAKE2b-256 80cc5199c9809bfcc9859653ecd2cd2b93bed51fbe762f5d5936da4687955e14

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