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)

NumPy Dependency

Before installing rawpy, you need to have numpy installed. You can check your numpy version with pip freeze.

The minimum supported numpy version depends on your Python version:

Python

numpy

2.7 - 3.3

>= 1.7.1

3.4

>= 1.8.1

3.5

>= 1.9.3

You can install numpy with pip install numpy.

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).

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 source 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.

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.1-cp35-none-win_amd64.whl (470.5 kB view details)

Uploaded CPython 3.5Windows x86-64

rawpy-0.5.1-cp35-none-win32.whl (418.7 kB view details)

Uploaded CPython 3.5Windows x86

rawpy-0.5.1-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.3 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.1-cp34-none-win_amd64.whl (309.6 kB view details)

Uploaded CPython 3.4Windows x86-64

rawpy-0.5.1-cp34-none-win32.whl (277.4 kB view details)

Uploaded CPython 3.4Windows x86

rawpy-0.5.1-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.6 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.1-cp33-none-win_amd64.whl (309.7 kB view details)

Uploaded CPython 3.3Windows x86-64

rawpy-0.5.1-cp33-none-win32.whl (277.3 kB view details)

Uploaded CPython 3.3Windows x86

rawpy-0.5.1-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.8 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.1-cp27-none-win_amd64.whl (336.9 kB view details)

Uploaded CPython 2.7Windows x86-64

rawpy-0.5.1-cp27-none-win32.whl (300.3 kB view details)

Uploaded CPython 2.7Windows x86

rawpy-0.5.1-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.7 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.1-cp35-none-win_amd64.whl.

File metadata

File hashes

Hashes for rawpy-0.5.1-cp35-none-win_amd64.whl
Algorithm Hash digest
SHA256 0ca2175a82a8f45c1aaa14c114851d4335ac3ee3ff4c4a05a91e6682f6ea7b9a
MD5 2efd3e5ed2d7629bc2fb728b6d6d7958
BLAKE2b-256 29fc81471cc0501f4c3ed49241c3cce4de71c95bb13e23f04321d36665b7d07b

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.5.1-cp35-none-win32.whl
Algorithm Hash digest
SHA256 54500420a7a778898aff9d6aa0e106942723027f0fb142ec2be93b436c825e13
MD5 da1b6a05de4d943f42902628cb03d9ed
BLAKE2b-256 b3182a0f424e4edb2faf30b963c28501ba2150fb3bcb656d339d404dcf17f6f3

See more details on using hashes here.

File details

Details for the file rawpy-0.5.1-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.1-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 a87df465d505951beaff4a6612c37dec75c79ff95faa2d98a8141eaa5cd89b01
MD5 2767ee2b96f2a837753f2f3e8c51b254
BLAKE2b-256 1e23b9ba8a4bf43c5b6906ac9c305e17aa2f12f574f8c2cc65666c39c4ff8037

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.5.1-cp34-none-win_amd64.whl
Algorithm Hash digest
SHA256 78bcfcfaa0c4cdcff0176d037443031a272c781109f8c79858930ee07553ae35
MD5 92759d6bdbd9d600c9b22aa4e54ad066
BLAKE2b-256 8bf31cfc2abd48eafebcf759d1f1d5b5c3eaa7a32ff85da22123b627df0dc7eb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.5.1-cp34-none-win32.whl
Algorithm Hash digest
SHA256 a6c68d0efe0dfb2012aae72c72764d70d34202cadf8b1895f3db10ec0a0ae621
MD5 6e15a2d27efb8b5ffb3a7c344ef9ebb4
BLAKE2b-256 140c91569c6ad6a0de7f076207c1c4f4f55ab6c7567abf5c6c45152b975e4c2f

See more details on using hashes here.

File details

Details for the file rawpy-0.5.1-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.1-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 d6bed46e1ec9ca05c8681ab2d8a8144688b1d5f1a88dc6370c2d4f98a965cc0e
MD5 d212f57189b5e2cdc1d680d3cbd1db73
BLAKE2b-256 36b832bc5f8272e08e6281cb3ee3bdfdf2b73c55e218ffd69d77afde1b7d3aa3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.5.1-cp33-none-win_amd64.whl
Algorithm Hash digest
SHA256 1c7ea5aaf70e70872378eb2aacd426161f05da5161f7febd05701bb8e940676a
MD5 c609c06b33e48bc1a6afa725e24c4667
BLAKE2b-256 b2ebbd723646abe5fcf797a699c1be99af693485cc264ce6a4bcfb29d70ae395

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.5.1-cp33-none-win32.whl
Algorithm Hash digest
SHA256 ef88f859292e604e5c6d5c7539706866b88847b8d50474c727debe6c4eb3ec32
MD5 c13852b326033c6a3d8be8884e9fd1ec
BLAKE2b-256 c83595a5ae36695eab7211cba3efaffbcd184efffdcce0607ae2843068a9c430

See more details on using hashes here.

File details

Details for the file rawpy-0.5.1-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.1-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 b7af2e87fb45cdf364d5855ae22b3ba705107259fd82abeb543830995c705705
MD5 63096ef69242713fdefa64282cb970e7
BLAKE2b-256 50b4668f97d90cb7964938cee63a1032c21e15136b50bf5ce469a81686df114e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for rawpy-0.5.1-cp27-none-win_amd64.whl
Algorithm Hash digest
SHA256 cc5982faf87bb71c5d30489c10637ed6c97534e1137c0f6018c7acd39e15e1f0
MD5 e35cec4f1b894246e1e09d84a7b3cdb5
BLAKE2b-256 0494d94f275281a51074cd577b78cc2b06ec9fd1112aa908ee5f2bb56e1f5dda

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rawpy-0.5.1-cp27-none-win32.whl
Algorithm Hash digest
SHA256 918e2081ffa8dbaed0be28aa648a81af600a969dbbfb0e70456bacc852621e37
MD5 aa8dc789fac9b1d9c38f5eb0278e9b73
BLAKE2b-256 a566dd01965e822a540696ee0fc36da2d64c41d0338b97dcb71ac518da76b920

See more details on using hashes here.

File details

Details for the file rawpy-0.5.1-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.1-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 e6d075d3137fdc253b3931c18cfc91640e5516abe3e3559c8a6c3fb66a4d5266
MD5 44ee57fce4e5495a642948d88b023afb
BLAKE2b-256 87c5c8578f26c7f4813d758408b25403e8239b4ae80aeed5a9fefb60a9273590

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