Skip to content

Commit

Permalink
updated flim:
Browse files Browse the repository at this point in the history
  - slightly decreased print density, making shadows not too dark
  - minor changes
  • Loading branch information
bean-mhm committed Jun 2, 2023
1 parent 194be49 commit 7a88ca0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions flim.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


vt_name = 'flim'
vt_version = '0.4.0'
vt_version = '0.5.0'


# Transform a 3D LUT
Expand Down Expand Up @@ -49,7 +49,7 @@ def apply_transform(table: np.ndarray, compress_lg2_min, compress_lg2_max, paral
table = np.maximum(table, 0.0)

# Pre-Exposure
pre_exposure = 1.0
pre_exposure = 0.95
table *= (2**pre_exposure)

# Apply element-wise transform (calls transform_rgb)
Expand Down Expand Up @@ -95,17 +95,17 @@ def run_parallel(table, indices):
# This function should only be called by apply_transform.
def transform_rgb(inp):
# Gamut Extension Matrix (Linear BT.709)
extend_mat = flim_gamut_extension_mat(red_scale = 1.05, green_scale = 1.12, blue_scale = 1.045, red_rot = 0.5, green_rot = 3.0, blue_rot = 0.0)
extend_mat = flim_gamut_extension_mat(red_scale = 1.05, green_scale = 1.12, blue_scale = 1.045, red_rot = 0.5, green_rot = 2.0, blue_rot = 0.0)
extend_mat_inv = np.linalg.inv(extend_mat)

# Convert to extended gamut
inp = np.matmul(extend_mat, inp)

# Develop Negative
inp = flim_rgb_develop(inp, exposure = 5.5, blue_sens = 1.0, green_sens = 1.0, red_sens = 1.0, max_density = 10.0)
inp = flim_rgb_develop(inp, exposure = 5.3, blue_sens = 1.0, green_sens = 1.0, red_sens = 1.0, max_density = 10.0)

# Develop Print
inp = flim_rgb_develop(inp, exposure = 5.5, blue_sens = 1.0, green_sens = 1.0, red_sens = 1.0, max_density = 14.2)
inp = flim_rgb_develop(inp, exposure = 5.3, blue_sens = 1.0, green_sens = 1.0, red_sens = 1.0, max_density = 13.3)

# Convert from extended gamut
inp = np.matmul(extend_mat_inv, inp)
Expand All @@ -114,10 +114,10 @@ def transform_rgb(inp):
inp = np.maximum(inp, 0.0)

# Highlight Cap
inp = inp / 0.883169
inp = inp / 0.91

# Black Point
inp = rgb_uniform_offset(inp, black_point = 0.84, white_point = 0.0)
inp = rgb_uniform_offset(inp, black_point = 1.47, white_point = 0.0)

# Clamp
inp = np.clip(inp, 0, 1)
Expand Down

0 comments on commit 7a88ca0

Please sign in to comment.