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, 3.4 and 3.5 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.5.0-cp35-none-win_amd64.whl (470.3 kB view details)

Uploaded CPython 3.5Windows x86-64

rawpy-0.5.0-cp35-none-win32.whl (418.6 kB view details)

Uploaded CPython 3.5Windows x86

rawpy-0.5.0-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (860.2 kB view details)

Uploaded CPython 3.5mmacOS 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.5.0-cp34-none-win_amd64.whl (371.8 kB view details)

Uploaded CPython 3.4Windows x86-64

rawpy-0.5.0-cp34-none-win32.whl (332.4 kB view details)

Uploaded CPython 3.4Windows x86

rawpy-0.5.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 (860.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.5.0-cp33-none-win_amd64.whl (371.9 kB view details)

Uploaded CPython 3.3Windows x86-64

rawpy-0.5.0-cp33-none-win32.whl (332.3 kB view details)

Uploaded CPython 3.3Windows x86

rawpy-0.5.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 (859.7 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.5.0-cp27-none-win_amd64.whl (397.7 kB view details)

Uploaded CPython 2.7Windows x86-64

rawpy-0.5.0-cp27-none-win32.whl (355.0 kB view details)

Uploaded CPython 2.7Windows x86

rawpy-0.5.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 (860.6 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.5.0-cp35-none-win_amd64.whl.

File metadata

File hashes

Hashes for rawpy-0.5.0-cp35-none-win_amd64.whl
Algorithm Hash digest
SHA256 7bfba91aea5172ba86f744faa39b7f446795f04c0870b0613230ac3499197baa
MD5 019ff91bca501f33257602eca5070bad
BLAKE2b-256 461001dd803cdc3921ee431c62d8bb0a5f7a7595ad674e3f324665ca45985629

See more details on using hashes here.

File details

Details for the file rawpy-0.5.0-cp35-none-win32.whl.

File metadata

  • Download URL: rawpy-0.5.0-cp35-none-win32.whl
  • Upload date:
  • Size: 418.6 kB
  • Tags: CPython 3.5, Windows x86
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rawpy-0.5.0-cp35-none-win32.whl
Algorithm Hash digest
SHA256 497b37f008b32d9a764e94e72cbf4fa89aca8e710adfe3b01a9548eaf31fb7a2
MD5 3431182efb01bf8b496cc1961c51b1c9
BLAKE2b-256 74b3fefb9fa4b0c8e5fe5af9df2ee5f424ffc05cc199bfd520a9783d6c7a5ef7

See more details on using hashes here.

File details

Details for the file rawpy-0.5.0-cp35-cp35m-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.5.0-cp35-cp35m-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 a6822b35e6ba6cb6194dbcb4a33a38b0193844b1f6e7bcdee02409b9c637e69c
MD5 0556ec2ee7d7d046c6ff9e7531bcb842
BLAKE2b-256 a8e3168bd8073d545d956cf57452674b04bffbe96e1e33e62a4f21abe23524eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.5.0-cp34-none-win_amd64.whl
Algorithm Hash digest
SHA256 3be1f19715e4b1450f20070612810d973499674f4bae2ee60d8cdde9f1b7e82a
MD5 3a6b135ebfa67dfba86757c75a11f79e
BLAKE2b-256 c23bba2df1469472155adb5716563e3b406ca3dfd13d18f525c4a3459dc56e20

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.5.0-cp34-none-win32.whl
Algorithm Hash digest
SHA256 981bee2d4ffe95fc3e0bee670b0f4ea1eda6d2c5ae6e9c1b5ed10ad3c6827cd8
MD5 5c149a93dc41298c4856f9b6099227e9
BLAKE2b-256 c32c7faab46fe207b89aff71831abaaf81e6d09d0099e754b992e0672b8e0006

See more details on using hashes here.

File details

Details for the file rawpy-0.5.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.5.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 69bc6c4fab6cacd5a01d09463d7ce574e202f8894e3c644853ca8a1de675f688
MD5 ca0478210d9c4d89b6bd2c68474d6a85
BLAKE2b-256 d806d83f9ca6544ce76343ed2e600d4afb5bdbe7b96fd0f65cb0ffa3350e39d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.5.0-cp33-none-win_amd64.whl
Algorithm Hash digest
SHA256 193bbac84b9f48a7b82fe1ceee34660bd8845ab09af8749f17f2be937f3e81a0
MD5 37507ad65fbdd08c1d20231052e04a35
BLAKE2b-256 dca746cf46e5e27a98d534ddd09d46c7d32194911bf92940d4b7c726a1712ec5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.5.0-cp33-none-win32.whl
Algorithm Hash digest
SHA256 bd4257ce5b38114dc9c699cf4ab91f1ecba4a486dcb629c8429d2c01eb70e72e
MD5 08159ed938323fbd1226808537a8d497
BLAKE2b-256 5e57dfb7ea894726476495f1553d17cc6035d3666808622b7fb9b9086d60ec62

See more details on using hashes here.

File details

Details for the file rawpy-0.5.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.5.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 a1199413d71be3bf00fa6aea35be8a4b699f410d39f6f2c2725352cb347bfaec
MD5 44cb7a18321b2b9ada08d2ef103837b3
BLAKE2b-256 6716b5072939f0df88275937a838e4b8c1243a1d792ba6b4d9aa1b8216948c94

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.5.0-cp27-none-win_amd64.whl
Algorithm Hash digest
SHA256 d04fc7d97a6bd2539927c50b34ba889b879921f4f266aa98e3325daae148165c
MD5 fa88c6e98515cf89218592130f235c60
BLAKE2b-256 cb618bb8413a6835d6e906c7ce8d80854060f01c1c20f2ce77c1ff33adbf9675

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.5.0-cp27-none-win32.whl
Algorithm Hash digest
SHA256 efd13853b2ef1a448126aa28e2bec861da4815fed50cf36f2676233d111c237c
MD5 0e8fbeb943c1a50ed778a201ee417d00
BLAKE2b-256 d1bc1ae9fe6b1d4b5c2a88a1cbe27144375fd08c3c2e91a05eeefe1ac617a902

See more details on using hashes here.

File details

Details for the file rawpy-0.5.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.5.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 dae547e1a8c4e6149c48a35d264e76a87a275111f8dd22391e8d1bf3dbbd8133
MD5 87efadea939de60bc54c26a73351ab3f
BLAKE2b-256 3471b427b68aa04dac4010b53f03deb05290e8caa6452f5f05a1eb1e3e05b395

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