Skip to content

Commit

Permalink
Stash current work.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Jul 3, 2024
1 parent 44e5923 commit 29f2462
Show file tree
Hide file tree
Showing 12 changed files with 2,345 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@
"from colour_hdri import (\n",
" ROOT_RESOURCES_EXAMPLES,\n",
" camera_neutral_to_xy,\n",
" camera_space_to_XYZ_matrix,\n",
" convert_dng_files_to_intermediate_files,\n",
" convert_raw_files_to_dng_files,\n",
" filter_files,\n",
" read_dng_files_exif_tags,\n",
" highlights_recovery_LCHab,\n",
" matrix_camera_space_to_XYZ,\n",
" update_exif_tags,\n",
")\n",
"from colour_hdri.models import (\n",
Expand Down Expand Up @@ -193,7 +193,7 @@
" analog_balance,\n",
" )\n",
"\n",
" M_camera_space_to_XYZ = camera_space_to_XYZ_matrix(\n",
" M_camera_space_to_XYZ = matrix_camera_space_to_XYZ(\n",
" xy,\n",
" CCT_calibration_illuminant_1,\n",
" CCT_calibration_illuminant_2,\n",
Expand All @@ -215,7 +215,7 @@
" read_dng_files_exif_tags((DNG_FILES[0],))[0]\n",
")\n",
"\n",
"# In order to avoid artefacts, white balancing should be peformed before\n",
"# In order to avoid artefacts, white balancing should be performed before\n",
"# demosaicing thus we need to pass appropriate gains to *dcraw*.\n",
"WHITE_BALANCE_MULTIPLIERS = colour.algebra.vector_dot(M_CAMERA_SPACE_TO_XYZ, np.ones(3))\n",
"\n",
Expand Down
1 change: 0 additions & 1 deletion colour_hdri/examples/examples_merge_from_ldr_files.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
" camera_response_functions_Debevec1997,\n",
" filter_files,\n",
" image_stack_to_HDRI,\n",
" weighting_function_Debevec1997,\n",
")\n",
"from colour_hdri.plotting import plot_HDRI_strip\n",
"\n",
Expand Down
123 changes: 70 additions & 53 deletions colour_hdri/examples/examples_merge_from_raw_files_using_rawpy.ipynb

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions colour_hdri/generation/hdri.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from __future__ import annotations

import numpy as np
from colour.constants import EPSILON
from colour.hints import ArrayLike, Callable, NDArrayFloat
from colour.utilities import as_float_array, tsplit, tstack, warning

Expand Down Expand Up @@ -98,12 +99,13 @@ def image_stack_to_HDRI(
f'"{image.path}" image channels contain negative or equal '
f"to zero values, unpredictable results may occur! Please "
f"consider encoding your images in a wider gamut RGB "
f"colourspace or clamp negative values."
f"colourspace."
)

image_data = np.clip(image.data, 0, 1)
image_data = np.clip(image.data, EPSILON, 1)

weights = np.clip(weighting_function(image_data), EPSILON, 1)

weights = weighting_function(image_data)
if i == 0:
weights[image_data >= 0.5] = 1
if i == len(image_stack) - 1:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added colour_hdri/graph/GraphRawProcessingDNG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added colour_hdri/graph/__init__.py
Empty file.
Loading

0 comments on commit 29f2462

Please sign in to comment.