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

Uploaded CPython 3.4Windows x86-64

rawpy-0.3.0-cp34-none-win32.whl (406.9 kB view details)

Uploaded CPython 3.4Windows x86

rawpy-0.3.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.3.0-cp33-none-win_amd64.whl (447.6 kB view details)

Uploaded CPython 3.3Windows x86-64

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

Uploaded CPython 3.3Windows x86

rawpy-0.3.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.3.0-cp27-none-win_amd64.whl (472.2 kB view details)

Uploaded CPython 2.7Windows x86-64

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

Uploaded CPython 2.7Windows x86

rawpy-0.3.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.3.0-cp34-none-win_amd64.whl.

File metadata

File hashes

Hashes for rawpy-0.3.0-cp34-none-win_amd64.whl
Algorithm Hash digest
SHA256 24b3833e64a9032875434843fdceb4db564f12da06517bc26a483bdb58fe2d07
MD5 a6f526dbaf31ce5e73da712866132eb9
BLAKE2b-256 2b10154dabcf10e221943a581eb117d1d39db10bf44caa25f9e9040f8c8e506d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.3.0-cp34-none-win32.whl
Algorithm Hash digest
SHA256 9cd85dad2e5abc40904743eda94e9a609c71fccfdb0211232248e108437ecf1a
MD5 82af3ead87cdb53526ff94e948bc1a44
BLAKE2b-256 a519abec48d3144cdecfe5475f40cbea19796d367aee59ec0699729383bc51c5

See more details on using hashes here.

File details

Details for the file rawpy-0.3.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.3.0-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 666e9cba7ac62d2d62fa06040afe09b56701f9047abc722387b348b9eb71d942
MD5 d329e0907d734bf4ae7a4413fa09f6e4
BLAKE2b-256 99c1f492eb6547b3c396282eac44c6514577417b7682c24262e47084091857af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.3.0-cp33-none-win_amd64.whl
Algorithm Hash digest
SHA256 3702760ac61cfde54e17774c1fbc5631a748519bbf3a4f728fdbd05120ac21ff
MD5 ac0811b2c7a5e653e3e32d45dd7a605b
BLAKE2b-256 0804318e9aca4baa3c92eb3884ec8cc2f5dfdcdec0d11d3092eb84489604ed5e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rawpy-0.3.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.3.0-cp33-none-win32.whl
Algorithm Hash digest
SHA256 213952b40b302362e8590b689087691a784830ced635a9d610be3427e2af0097
MD5 da1594908ae27ff79847c1d32da31eaa
BLAKE2b-256 b1e361a48fcc893e3a39743b358fe57977074e336b3979ac0852744dacc8ce38

See more details on using hashes here.

File details

Details for the file rawpy-0.3.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.3.0-cp33-cp33m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 af1f7bc038045364fc491e7c8ff794fbc6712e27666f453b1086b480e6510e32
MD5 955d45ba08bc95cdcbd3103a6993f552
BLAKE2b-256 34c9b6a0a1efd4b3e719e8a37135ebb3f0826194a750497ae2d763b17188503e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.3.0-cp27-none-win_amd64.whl
Algorithm Hash digest
SHA256 15017824a5b86a3ac865954c60cf8750c840d559135f09d3db9242e8e3220cf8
MD5 a636ac76186a98e31a439b318c092566
BLAKE2b-256 f8ae9d345473f0d22cf5fc9217c4de134b2247247e75857c4c421021d18025de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rawpy-0.3.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.3.0-cp27-none-win32.whl
Algorithm Hash digest
SHA256 2f9506e012e7bc5207c81122128ee100961edc7387f117b0591bd6b6ef4ecb50
MD5 fb1fa2999c308992b5e5578f951e40c8
BLAKE2b-256 faf35c37e2937f03511d072ba63b9858942ced1b2252e7814564aa0005bc38c1

See more details on using hashes here.

File details

Details for the file rawpy-0.3.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.3.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a0e52dba749629cfac917aade452416431d093f83a7ac12b12ee379c7dd8c040
MD5 76486ed8738dee6dd2c927592e359cee
BLAKE2b-256 3dd3bf86241b6f10843695f4e6e802d5fa0dfa1f18724be6a12f9d1c06abb501

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