Python wrapper for the LibRaw library
Project description
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'
with rawpy.imread(path) as raw:
rgb = raw.postprocess()
imageio.imsave('default.tiff', rgb)
Save as 16-bit linear image:
with rawpy.imread(path) as raw:
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:
with rawpy.imread(path) as raw:
rawpy.enhance.repair_bad_pixels(raw, bad_pixels, method='median')
rgb = raw.postprocess()
imageio.imsave(path + '.tiff', rgb)
Installation on Windows and macOS
Binaries are provided for Python 2.7, 3.4, 3.5, and 3.6. These can be installed with a simple pip install rawpy (or pip install --use-wheel 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 release version from the source repository:
git clone https://github.com/LibRaw/LibRaw.git libraw
git clone https://github.com/LibRaw/LibRaw-cmake.git libraw-cmake
cd libraw
git checkout 0.18.2
cp -R ../libraw-cmake/* .
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 (if installed manually) and apparently this folder is not searched for libraries by default in some Linux distributions.
NumPy Dependency
rawpy depends on NumPy. The minimum supported NumPy version depends on your Python version:
Python |
NumPy |
2.7 |
>= 1.7 |
3.4 |
>= 1.8 |
3.5 |
>= 1.9 |
3.6 |
>= 1.11 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for rawpy-0.10.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1199e379fea45028a88e078e99400f482745c6e1e1d9113edfc727bdf2002b59 |
|
MD5 | 231534f425f36dacf31a25147b6b7d81 |
|
BLAKE2b-256 | 8417ef7cf46723ee297f0a3de5d1172b9ee5b3ce1c6af46fca1e11ddd88783ae |
Hashes for rawpy-0.10.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b62e39aa73d44190299fa88d9125ba7c5dbe099f1cdecdb946c0e655296bba8 |
|
MD5 | e648f3c5ea44229e2fa62cf575a9d8dd |
|
BLAKE2b-256 | df81eddbf476330b234168885b9c89c108eccbe152b55fdec45c68fa32253358 |
Hashes for rawpy-0.10.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54eb2c4aadb6901b4117ab15ef11e66705a520ed4f1d97784c2fdae37a21e8f9 |
|
MD5 | e05b0a826e6f7a706de8aaa016adeee0 |
|
BLAKE2b-256 | d2b3aeaf27a84fdcf8549eb56195bcaf2946a6d64e38d1ac6cca45b6918ea0ef |
Hashes for rawpy-0.10.0-cp36-cp36m-macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f8bfad898eff30443a8074c52b42b78e1dca839ce2ed735590b95ad271d0805 |
|
MD5 | 57901dab42bbc94591fb877de3db7462 |
|
BLAKE2b-256 | 727a64219d838e2630941b8241c4df0346632ba09ab1615770ea24050c7dad5a |
Hashes for rawpy-0.10.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c70cce8fe303448de762ad1ba6d6935889a9d08e436861736d42dc77a34ac964 |
|
MD5 | 1a2de85e25d563438e85dc6cdae260b7 |
|
BLAKE2b-256 | 201b7ad42636cbad4752e9e93b8728985a3d5cc98e846eefc2085ca3131bf47f |
Hashes for rawpy-0.10.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1777c1981b3d112fe88c9855ef695c1fa338ddb300bd6e30edfbdc984afe6fb0 |
|
MD5 | 7b42be22a533b5c8671abcabc6b5e6d3 |
|
BLAKE2b-256 | 9b56527c3e0028f0cf8026446a50dbb728a5a0de52f99d30903aaedfddd2eb0a |
Hashes for rawpy-0.10.0-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8910ce178a31885a682bd3de56f90e6863f7bf3e8f08b9b6f25967b86c56cd8 |
|
MD5 | 9f97658b684b1b8f769223397c1c6f6a |
|
BLAKE2b-256 | 6a4c1b18fcf8eec88f0ff00343b77330828a4f7e961f0e9ad70085df72bf9511 |
Hashes for rawpy-0.10.0-cp35-cp35m-macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75ae5462dace28cc2081086164a2f16c69909b37237076b7f41faa61364ad83e |
|
MD5 | b3f91b53f25fd40eec88d99412927e04 |
|
BLAKE2b-256 | 64e20cd1c918e837b108a9cf6aca0bacdf2414bdc7604606f7e4b176699aa9c3 |
Hashes for rawpy-0.10.0-cp34-cp34m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2de9f1c7472acc4439cfe0af713439f34ede7f950285bb7c3b212aaa6c5568ea |
|
MD5 | cafcf0ea6bd27b8f118b5d37f9ba7ab3 |
|
BLAKE2b-256 | 8215eb07153bc2408b323c51fb9be2e4b3f0a05062a58b4850e73b6025e4f7bc |
Hashes for rawpy-0.10.0-cp34-cp34m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e12791264e0e55782ed8291e1597c8e263553a861e0f57cc7bdab4a177818ed2 |
|
MD5 | d7e9ef3f4eef67dfc0162745aa69a332 |
|
BLAKE2b-256 | d7861d50b7531200dc6364c4485849fa63d6965acf46a55eb3ed6a5d3821c8a9 |
Hashes for rawpy-0.10.0-cp34-cp34m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b11c02618344bdd6e82eb8ada173c21cffe4b33859225971149763ee56360db2 |
|
MD5 | 824d71eb7395ee537a1b64ce7510d2a1 |
|
BLAKE2b-256 | bc7a4ef75961a1577231dd1bb9640446c519660206d5b54ed2f780486d2d9c68 |
Hashes for rawpy-0.10.0-cp34-cp34m-macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a28cca7fcced128ebfb67e8d9f64f49cafbc97f09a6faa5f30bfede2cd3bda87 |
|
MD5 | 78723677b7da7290ba13d573861c84b1 |
|
BLAKE2b-256 | d84e3202baadba7972e7327045812685581e10a14145ebc0d05b0380a351938e |
Hashes for rawpy-0.10.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dffecc7f8754ee931fb96342d4937140f3754524df9eaff84650ed430d4ceb39 |
|
MD5 | 619449f1a4ed8a7f5dcafb0b85fcc68b |
|
BLAKE2b-256 | e905d40c2dcd84bb0057d9a42e1127834de39b4c94a6215334748f0770eec4fd |
Hashes for rawpy-0.10.0-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2953a229fa94f6b1321c31636f7208f15400b8aec8ed616c6b14acf1691bcfa2 |
|
MD5 | c0e035af895ac3e2ff004eb58f602c4e |
|
BLAKE2b-256 | cdca06d1946224fb4a3b131cfb45b98b24477d6cc25ab16d06f86939e9069e5c |
Hashes for rawpy-0.10.0-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d3224bd7f545cbd49d55557214816a1c76b91747ba7dfcb980da770579be6b7 |
|
MD5 | 678e840c05e3049d7302fcb8772da3d2 |
|
BLAKE2b-256 | c9fd0e780674241d32f127659ea37fa66efbdb7438b09fc3d41f6b3b71bfb53e |
Hashes for rawpy-0.10.0-cp27-cp27m-macosx_10_10_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a21eab320d42267a27d3545da2514cb8986dcbd42f42295ecd556c4d51a26429 |
|
MD5 | 24ccda44ceaa9ff1f27d895bae64c3de |
|
BLAKE2b-256 | 2d60434322345b613dbf26a3c8f32c4c8d5113a5b25c8d774eb47aba4d65aeea |