Skip to content

Commit 88e78a0

Browse files
committed
Merge branch 'feature/v0.2.6' into develop
2 parents 90c7698 + 757422b commit 88e78a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1135
-514
lines changed

.github/workflows/continuous-integration-quality-unit-tests.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ jobs:
4747
- name: Install Dependencies (Windows)
4848
if: matrix.os == 'windows-latest'
4949
run: |
50-
curl -L https://exiftool.org/exiftool-12.98_64.zip -o exiftool-12.98_64.zip
51-
unzip -d exiftool exiftool-12.98_64.zip
52-
cp exiftool/exiftool-12.98_64/exiftool\(-k\).exe exiftool/exiftool-12.98_64/exiftool.exe
53-
echo "$PWD/exiftool/exiftool-12.98_64" | sed -e 's/^\///' -e 's/\//\\/g' -e 's/^./\0:/' >> $GITHUB_PATH
50+
curl -L https://exiftool.org/exiftool-13.32_32.zip -o exiftool-13.32_32.zip
51+
unzip -d exiftool exiftool-13.32_32.zip
52+
cp exiftool/exiftool-13.32_32/exiftool\(-k\).exe exiftool/exiftool-13.32_32/exiftool.exe
53+
echo "$PWD/exiftool/exiftool-13.32_32" | sed -e 's/^\///' -e 's/\//\\/g' -e 's/^./\0:/' >> $GITHUB_PATH
5454
curl -L https://cdn.fastpictureviewer.com/bin/dcraw.zip?v=201605100 -o dcraw.zip
5555
unzip -d dcraw dcraw.zip
5656
echo "$PWD/dcraw" | sed -e 's/^\///' -e 's/\//\\/g' -e 's/^./\0:/' >> $GITHUB_PATH
@@ -75,13 +75,6 @@ jobs:
7575
uv sync --all-extras
7676
uv run python -c "import imageio;imageio.plugins.freeimage.download()"
7777
shell: bash
78-
- name: Install OpenImageIO (macOs)
79-
if: matrix.os == 'macOS-latest' && matrix.python-version == '3.13'
80-
run: |
81-
brew install openimageio
82-
ln -s /opt/homebrew/Cellar/openimageio/*/lib/python*/site-packages/OpenImageIO/OpenImageIO*.so ./.venv/lib/python${{ matrix.python-version }}/site-packages/OpenImageIO.so
83-
uv run python -c "import OpenImageIO;print(OpenImageIO.__version__)"
84-
shell: bash
8578
- name: Pre-Commit (All Files)
8679
run: |
8780
uv run pre-commit run --all-files

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ repos:
1515
- id: requirements-txt-fixer
1616
- id: trailing-whitespace
1717
- repo: https://github.com/codespell-project/codespell
18-
rev: v2.3.0
18+
rev: v2.4.1
1919
hooks:
2020
- id: codespell
2121
args: ["--ignore-words-list=socio-economic"]
2222
exclude: "BIBLIOGRAPHY.bib|CONTRIBUTORS.rst|.*.ipynb"
2323
- repo: https://github.com/PyCQA/isort
24-
rev: "5.13.2"
24+
rev: "6.0.1"
2525
hooks:
2626
- id: isort
2727
- repo: https://github.com/astral-sh/ruff-pre-commit
28-
rev: "v0.8.2"
28+
rev: "v0.12.4"
2929
hooks:
3030
- id: ruff-format
3131
- id: ruff

colour_hdri/__init__.py

Lines changed: 69 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
Colour - HDRI
33
=============
44
5-
HDRI processing algorithms for *Python*.
5+
High Dynamic Range Imaging (HDRI) processing algorithms for *Python*.
6+
7+
This package provides computational tools for HDRI capture, processing, and
8+
display, including camera response function estimation, exposure merging,
9+
tone mapping operators, and colour space transformations. The algorithms
10+
support various workflows from raw image capture to final display-ready
11+
output with advanced highlight recovery and vignetting correction.
612
713
Subpackages
814
-----------
@@ -21,8 +27,6 @@
2127
- utilities: Various utilities and data structures.
2228
"""
2329

24-
# isort: skip_file
25-
2630
from __future__ import annotations
2731

2832
import contextlib
@@ -31,16 +35,43 @@
3135
import sys
3236
import typing
3337

34-
import colour
35-
import numpy as np
36-
3738
if typing.TYPE_CHECKING:
3839
from colour.hints import Any
3940

41+
import colour
42+
import numpy as np
4043
from colour.utilities import is_matplotlib_installed
4144
from colour.utilities.deprecation import ModuleAPI, build_API_changes
4245
from colour.utilities.documentation import is_documentation_building
4346

47+
from .utilities import (
48+
EXIF_EXECUTABLE,
49+
EXIFTag,
50+
Image,
51+
ImageStack,
52+
Metadata,
53+
copy_exif_tags,
54+
delete_exif_tags,
55+
filter_files,
56+
is_lensfunpy_installed,
57+
is_opencv_installed,
58+
is_rawpy_installed,
59+
parse_exif_array,
60+
parse_exif_data,
61+
parse_exif_fraction,
62+
parse_exif_number,
63+
parse_exif_string,
64+
path_exists,
65+
read_exif_tag,
66+
read_exif_tags,
67+
update_exif_tags,
68+
vivification,
69+
vivified_to_dict,
70+
write_exif_tag,
71+
)
72+
73+
# isort: split
74+
4475
from .calibration import (
4576
absolute_luminance_calibration_Lagarde2016,
4677
camera_response_functions_Debevec1997,
@@ -111,31 +142,9 @@
111142
tonemapping_operator_simple,
112143
tonemapping_operator_Tumblin1999,
113144
)
114-
from .utilities import (
115-
EXIF_EXECUTABLE,
116-
EXIFTag,
117-
Image,
118-
ImageStack,
119-
Metadata,
120-
copy_exif_tags,
121-
delete_exif_tags,
122-
filter_files,
123-
is_lensfunpy_installed,
124-
is_opencv_installed,
125-
is_rawpy_installed,
126-
parse_exif_array,
127-
parse_exif_data,
128-
parse_exif_fraction,
129-
parse_exif_number,
130-
parse_exif_string,
131-
path_exists,
132-
read_exif_tag,
133-
read_exif_tags,
134-
update_exif_tags,
135-
vivification,
136-
vivified_to_dict,
137-
write_exif_tag,
138-
)
145+
146+
# isort: split
147+
139148
from .network import (
140149
GraphBatchMergeHDRI,
141150
GraphHDRI,
@@ -177,7 +186,7 @@ class MockPlotting: # pragma: no cover
177186
"""
178187

179188
def __getattr__(self, attribute: str) -> Any:
180-
"""Return the value from the attribute with given name."""
189+
"""Return the value from the attribute with specified name."""
181190

182191
is_matplotlib_installed(raise_exception=True)
183192

@@ -192,6 +201,31 @@ def __getattr__(self, attribute: str) -> Any:
192201
__status__ = "Production"
193202

194203
__all__ = [
204+
"EXIF_EXECUTABLE",
205+
"EXIFTag",
206+
"Image",
207+
"ImageStack",
208+
"Metadata",
209+
"copy_exif_tags",
210+
"delete_exif_tags",
211+
"filter_files",
212+
"is_lensfunpy_installed",
213+
"is_opencv_installed",
214+
"is_rawpy_installed",
215+
"parse_exif_array",
216+
"parse_exif_data",
217+
"parse_exif_fraction",
218+
"parse_exif_number",
219+
"parse_exif_string",
220+
"path_exists",
221+
"read_exif_tag",
222+
"read_exif_tags",
223+
"update_exif_tags",
224+
"vivification",
225+
"vivified_to_dict",
226+
"write_exif_tag",
227+
]
228+
__all__ += [
195229
"absolute_luminance_calibration_Lagarde2016",
196230
"camera_response_functions_Debevec1997",
197231
"g_solve",
@@ -264,31 +298,6 @@ def __getattr__(self, attribute: str) -> Any:
264298
"tonemapping_operator_simple",
265299
"tonemapping_operator_Tumblin1999",
266300
]
267-
__all__ += [
268-
"EXIF_EXECUTABLE",
269-
"EXIFTag",
270-
"Image",
271-
"ImageStack",
272-
"Metadata",
273-
"copy_exif_tags",
274-
"delete_exif_tags",
275-
"filter_files",
276-
"is_rawpy_installed",
277-
"is_lensfunpy_installed",
278-
"is_opencv_installed",
279-
"parse_exif_array",
280-
"parse_exif_data",
281-
"parse_exif_fraction",
282-
"parse_exif_number",
283-
"parse_exif_string",
284-
"path_exists",
285-
"read_exif_tag",
286-
"read_exif_tags",
287-
"update_exif_tags",
288-
"vivification",
289-
"vivified_to_dict",
290-
"write_exif_tag",
291-
]
292301
__all__ += [
293302
"GraphBatchMergeHDRI",
294303
"GraphHDRI",
@@ -308,8 +317,8 @@ def __getattr__(self, attribute: str) -> Any:
308317
"NodeDownsample",
309318
"NodeMergeImageStack",
310319
"NodeNormaliseExposure",
311-
"NodeProcessRawFileRawpy",
312320
"NodeProcessingMetadata",
321+
"NodeProcessRawFileRawpy",
313322
"NodeReadFileMetadataDNG",
314323
"NodeReadImage",
315324
"NodeRemoveFile",
@@ -335,7 +344,7 @@ def __getattr__(self, attribute: str) -> Any:
335344

336345
try:
337346
_version: str = (
338-
subprocess.check_output( # noqa: S603
347+
subprocess.check_output(
339348
["git", "describe"], # noqa: S607
340349
cwd=os.path.dirname(__file__),
341350
stderr=subprocess.STDOUT,
@@ -383,7 +392,7 @@ class colour_hdri(ModuleAPI):
383392
"""Define a class acting like the *colour_hdri* module."""
384393

385394
def __getattr__(self, attribute: str) -> Any:
386-
"""Return the value from the attribute with given name."""
395+
"""Return the value from the attribute with specified name."""
387396

388397
return super().__getattr__(attribute)
389398

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1-
# isort: skip_file
1+
"""
2+
Camera Calibration
3+
==================
4+
5+
Camera response function estimation and absolute luminance calibration.
6+
7+
This subpackage provides algorithms for determining camera response functions
8+
from image sequences with known exposure values, and methods for absolute
9+
luminance calibration using reference illumination measurements.
10+
"""
211

312
from .absolute_luminance import (
4-
upper_hemisphere_illuminance_weights_Lagarde2016,
513
absolute_luminance_calibration_Lagarde2016,
14+
upper_hemisphere_illuminance_weights_Lagarde2016,
615
)
7-
from .debevec1997 import g_solve, camera_response_functions_Debevec1997
16+
17+
# isort: split
18+
19+
from .debevec1997 import camera_response_functions_Debevec1997, g_solve
820

921
__all__ = [
10-
"upper_hemisphere_illuminance_weights_Lagarde2016",
1122
"absolute_luminance_calibration_Lagarde2016",
23+
"upper_hemisphere_illuminance_weights_Lagarde2016",
1224
]
1325
__all__ += [
14-
"g_solve",
1526
"camera_response_functions_Debevec1997",
27+
"g_solve",
1628
]

colour_hdri/calibration/debevec1997.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def extrapolating_function_polynomial(
143143
) -> NDArrayFloat:
144144
"""
145145
Polynomial extrapolating function used to handle zero-weighted data of
146-
given camera response functions.
146+
specified camera response functions.
147147
148148
The extrapolation occurs where the weighting function masks fully the
149149
camera response functions, e.g., at both ends for *Debevec (1997)*.
@@ -194,7 +194,7 @@ def camera_response_functions_Debevec1997(
194194
normalise: bool = True,
195195
) -> NDArrayFloat:
196196
"""
197-
Return the camera response functions for given image stack using
197+
Return the camera response functions for specified image stack using
198198
*Debevec (1997)* method.
199199
200200
Image channels are sampled with :math:`s` sampling function and the output

colour_hdri/distortion/__init__.py

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,44 @@
1-
# isort: skip_file
1+
"""
2+
Lens Distortion Correction
3+
==========================
4+
5+
Vignetting characterisation and correction algorithms.
6+
7+
This subpackage provides methods for characterising and correcting lens
8+
vignetting effects using various mathematical models including 2D functions,
9+
bivariate splines, and radial basis functions.
10+
"""
211

312
from .vignette import (
4-
apply_radial_gradient,
5-
parabolic_2D_function,
6-
hyperbolic_cosine_2D_function,
13+
VIGNETTE_CHARACTERISATION_METHODS,
14+
VIGNETTE_CORRECTION_METHODS,
715
DataVignetteCharacterisation,
16+
apply_radial_gradient,
17+
characterise_vignette,
818
characterise_vignette_2D_function,
9-
correct_vignette_2D_function,
1019
characterise_vignette_bivariate_spline,
11-
correct_vignette_bivariate_spline,
1220
characterise_vignette_RBF,
13-
correct_vignette_RBF,
14-
VIGNETTE_CHARACTERISATION_METHODS,
15-
characterise_vignette,
16-
VIGNETTE_CORRECTION_METHODS,
1721
correct_vignette,
22+
correct_vignette_2D_function,
23+
correct_vignette_bivariate_spline,
24+
correct_vignette_RBF,
25+
hyperbolic_cosine_2D_function,
26+
parabolic_2D_function,
1827
)
1928

2029
__all__ = [
21-
"apply_radial_gradient",
22-
"parabolic_2D_function",
23-
"hyperbolic_cosine_2D_function",
30+
"VIGNETTE_CHARACTERISATION_METHODS",
31+
"VIGNETTE_CORRECTION_METHODS",
2432
"DataVignetteCharacterisation",
33+
"apply_radial_gradient",
34+
"characterise_vignette",
2535
"characterise_vignette_2D_function",
26-
"correct_vignette_2D_function",
2736
"characterise_vignette_bivariate_spline",
28-
"correct_vignette_bivariate_spline",
2937
"characterise_vignette_RBF",
30-
"correct_vignette_RBF",
31-
"VIGNETTE_CHARACTERISATION_METHODS",
32-
"characterise_vignette",
33-
"VIGNETTE_CORRECTION_METHODS",
3438
"correct_vignette",
39+
"correct_vignette_2D_function",
40+
"correct_vignette_bivariate_spline",
41+
"correct_vignette_RBF",
42+
"hyperbolic_cosine_2D_function",
43+
"parabolic_2D_function",
3544
]

0 commit comments

Comments
 (0)