Exposure Fusion
Python implementation of exposure fusion of multiple images, using the algorithm described in:
Mertens, Tom, Jan Kautz, and Frank Van Reeth. "Exposure Fusion." Computer Graphics and Applications, 2007. PG'07. 15th Pacific Conference on. IEEE, 2007.
Combines a bracket of differently-exposed images into a single well-exposed result via multi-resolution pyramid blending, without HDR radiance map estimation or tone mapping.
Features
- Exposure fusion — Laplacian pyramid blending with contrast, saturation, and well-exposedness weighting
- Automatic alignment — Translation-only alignment via ECC (Enhanced Correlation Coefficient), pure NumPy
- Time-decay weighting — Progressive weighting for sequential image stacks (e.g. time-lapses)
- No OpenCV required — All image operations reimplemented in NumPy; runtime deps are
numpy+Pillowonly
Requirements
- Python >= 3.10
numpyPillow
OpenCV is optional and only needed for running the test suite.
Installation
pip install exposure_fusion
Or from a local checkout:
pip install .
With test dependencies:
pip install "exposure_fusion[test]"
CLI Usage
exposure-fusion [-h] [-o OUTPUT] [-d DEPTH] [--time-decay TIME_DECAY]
[--align] [-v] IMAGE [IMAGE ...]
Arguments:
| Argument | Description |
|---|---|
IMAGE (positional, 2+) |
Input image file paths |
-o, --output |
Output image path (default: fusion.jpg) |
-d, --depth |
Pyramid depth (default: 3) |
--time-decay |
Time decay factor for sequential images |
--align |
Enable translation alignment before fusion |
-v, --verbose |
Print progress messages to stderr |
Examples:
exposure-fusion samples/peyrou_mean.jpg samples/peyrou_under.jpg samples/peyrou_over.jpg -o result.jpg
exposure-fusion --align -d 4 samples/peyrou_mean.jpg samples/peyrou_under.jpg samples/peyrou_over.jpg -o result.jpg
exposure-fusion --time-decay 4 samples/time_decay_1.png samples/time_decay_2.png samples/time_decay_3.png samples/time_decay_4.png -o fusion.png
Also invocable as python -m exposure_fusion.
Python API
Pass file paths directly to exposure_fusion and align_images — no manual I/O needed:
from exposure_fusion import exposure_fusion, align_images, load_image, save_image
# Load bracket exposures
img1 = load_image('samples/peyrou_mean.jpg')
img2 = load_image('samples/peyrou_under.jpg')
img3 = load_image('samples/peyrou_over.jpg')
# Optional alignment
images = align_images([img1, img2, img3])
# Fuse
fusion = exposure_fusion(images, depth=4)
save_image('samples/peyrou_fusion.jpg', fusion)
# Or pass paths directly — no load_image needed:
fusion = exposure_fusion([
'samples/peyrou_mean.jpg',
'samples/peyrou_under.jpg',
'samples/peyrou_over.jpg',
], depth=4)
save_image('samples/peyrou_fusion.jpg', fusion)
# Time-decay fusion (e.g. time-lapse)
images = [load_image(f'samples/time_decay_{i}.png') for i in range(1, 5)]
fusion = exposure_fusion(images, depth=3, time_decay=4)
save_image('samples/time_decay_fusion.png', fusion)
Tests
pip install "exposure_fusion[test]"
pytest tests/
License
MIT
Metadata
Release files for exposure-fusion 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| exposure_fusion-0.3.tar.gz | 13.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| exposure_fusion-0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.5 kB
Release files / exposure_fusion-0.3.tar.gz
| Download URL | exposure_fusion-0.3.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
340bf1c8392e918fc74950e17171be925a9085d1edf8ae406949f9b2c743b22d
|
|
BLAKE2b-256 checksum How to use checksums |
d997197e4bd1f830c0686f175250328ee22fada6b9f5616f93459933b987be5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / exposure_fusion-0.3-py3-none-any.whl
| Download URL | exposure_fusion-0.3-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0a94a2e81c18d561259c5b8c036159d54d41f80d66588d1947c505f242c7f2dc
|
|
BLAKE2b-256 checksum How to use checksums |
d9c3942a7bfd8b652cc1fbdc3dee312026175b65874aaae8cc48e041dcbac859
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Security for exposure-fusion 0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.