RawHandler
RawHandler is a lightweight wrapper around rawpy that provides convenient tools for working with raw sensor data, particularly for training neural networks on raw images.
Features
RawHandler can:
-
Open and convert most camera raw files into numpy arrays.
-
Apply black and white point correction automatically.
-
Provide multiple representations of the underlying sensor data:
- Mono Bayer representation
- 3-channel sparse representation
- 4-channel RGGB representation
-
Demosaic Bayer data using colour-demosaicing, supporting:
- Bilinear interpolation
- Malvar–He–Cutler (2004)
- DDFAPD – Menon et al. (2007)
-
Convert color spaces from the camera’s native space to standard targets such as XYZ, sRGB, AdobeRGB, or linear Rec.2020 — all available for every representation.
-
Crop, resize, and generate thumbnails while preserving Bayer pattern alignment.
-
Read EXIF/metadata information (ISO, shutter speed, orientation, etc.) and return it as a convenient Python dictionary.
Currently supported: Bayer raw images In progress: Fujifilm X-Trans support
Installation
You can install RawHandler directly from PyPI:
pip install RawHandler
Or install locally from source:
# Clone the repository
git clone https://github.com/rymuelle/RawHandler.git
cd RawHandler
# Editable/development install
pip install -e .
# Standard local install
pip install .
Example
A simple demo notebook is available:
examples/simple_demosaicing.ipynb
This example downloads a raw image and demonstrates the basic functionality of RawHandler.
License
This project is released under the MIT License.
Acknowledgments
Special thanks to the authors of RawNIND:
Brummer, Benoit; De Vleeschouwer, Christophe, 2025. Raw Natural Image Noise Dataset. https://doi.org/10.14428/DVN/DEQCIM, Open Data @ UCLouvain, V1.
Metadata
Release files for RawHandler 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rawhandler-0.2.2.tar.gz | 17.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rawhandler-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.9 kB
Release files / rawhandler-0.2.2.tar.gz
| Download URL | rawhandler-0.2.2.tar.gz |
|---|---|
| Size | 17.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b91b5e24b1f82588ab96efcab70131f7b355f7df4d8eca0744ed6de80be29a32
|
|
BLAKE2b-256 checksum How to use checksums |
d63ffc3e5446cbf4e047408415c943360dc6eaadeb83ed7fd6a3b0d30b4aba0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / rawhandler-0.2.2-py3-none-any.whl
| Download URL | rawhandler-0.2.2-py3-none-any.whl |
|---|---|
| Size | 19.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
888b817669394ad190c5e2b9bc6905006b76e28423a3f5d987bb9e1f470a4e27
|
|
BLAKE2b-256 checksum How to use checksums |
ae43a9a1698fa53a9f199826b315316a5a253ef4eeec0aef5d797bb44bb0637f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|