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

Uploaded CPython 3.4Windows x86-64

rawpy-0.1.0-cp34-none-win32.whl (449.9 kB view details)

Uploaded CPython 3.4Windows x86

rawpy-0.1.0-cp33-none-win_amd64.whl (498.3 kB view details)

Uploaded CPython 3.3Windows x86-64

rawpy-0.1.0-cp33-none-win32.whl (449.0 kB view details)

Uploaded CPython 3.3Windows x86

rawpy-0.1.0-cp27-none-win_amd64.whl (525.0 kB view details)

Uploaded CPython 2.7Windows x86-64

rawpy-0.1.0-cp27-none-win32.whl (471.3 kB view details)

Uploaded CPython 2.7Windows x86

File details

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

File metadata

File hashes

Hashes for rawpy-0.1.0-cp34-none-win_amd64.whl
Algorithm Hash digest
SHA256 187bde3079b2c95b25a862a074de6d676363ea51401642f68636789b9bb3f024
MD5 6d4be917f3e6961df03f4c345d87d6d1
BLAKE2b-256 40c93d8c8e23bf7ff858b9cf87699f448adfbf2e84b2b7430d37ebb4cdd1857f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.1.0-cp34-none-win32.whl
Algorithm Hash digest
SHA256 158f8f1a7bf42c392bf057933bdd85b8794866ede35bcf3bfd43dcffd02fc5ca
MD5 d2f8485b2ecfe4c7cc8c82e6c01f6c7e
BLAKE2b-256 ba90db8336ab723bc957d88ecd84ba0d6d18d0daa522900e23f84210e937ac5a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.1.0-cp33-none-win_amd64.whl
Algorithm Hash digest
SHA256 45bececaf3d041ec66443ec8b095458b7aaa7038dae21e26a28487174db560cb
MD5 128e54396051385b14dab33252cddc5f
BLAKE2b-256 92e90c80e2b72507897a4223be402e3ff4b37b19e0d2b7886c58d3726d364ddf

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.1.0-cp33-none-win32.whl
Algorithm Hash digest
SHA256 89ff86b66bc7bb0d2cd164dc36067ac704652ce64527a04d979070da18a00d6d
MD5 396f93f6f9bc7e64ee5967d932fbf444
BLAKE2b-256 f7b69b873b69e2e91985017e0a9edddbecb34017e32801c2e445375a786d5499

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.1.0-cp27-none-win_amd64.whl
Algorithm Hash digest
SHA256 76013df3c16bc102bc7aa6693e4fc813020b85fd86b161ebdfe83734dbe38ce8
MD5 ae6af3b969f45298763d044953c68cd6
BLAKE2b-256 c22eb74d38ddef41d8d7bd2947e099414001e0916e8ff27ceef59526c4030124

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.1.0-cp27-none-win32.whl
Algorithm Hash digest
SHA256 0eb8ddac78cb3c263e8b3c6bec2d5095df0963856828a2fd6764bad37a7e002a
MD5 7e9ea5def78565ada90ba1f3603f93a3
BLAKE2b-256 d57790851b9b3f86d553ddefd7f8f330d887cd9f56af9c2312a32ea427700729

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