handle en tags with same names as en itself

This commit is contained in:
Vladimir Mandic
2024-01-13 08:44:23 -05:00
parent 6ff7e5c301
commit 560e5a86e3
5 changed files with 26 additions and 14 deletions
+6 -2
View File
@@ -55,8 +55,12 @@ def setup_color_correction(image):
def apply_color_correction(correction, original_image):
shared.log.debug(f"Applying color correction: correction={correction} image={original_image}")
image = Image.fromarray(cv2.cvtColor(exposure.match_histograms(cv2.cvtColor(np.asarray(original_image), cv2.COLOR_RGB2LAB), correction, channel_axis=2), cv2.COLOR_LAB2RGB).astype("uint8"))
shared.log.debug(f"Applying color correction: correction={correction.shape} image={original_image}")
np_image = np.asarray(original_image)
np_recolor = cv2.cvtColor(np_image, cv2.COLOR_RGB2LAB)
np_match = exposure.match_histograms(np_recolor, correction, channel_axis=2)
np_output = cv2.cvtColor(np_match, cv2.COLOR_LAB2RGB)
image = Image.fromarray(np_output.astype("uint8"))
image = blendLayers(image, original_image, BlendType.LUMINOSITY)
return image