1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 01:36:27 +00:00

fix interpanel crop with color images with black borders; (#1094)

This commit is contained in:
Alex Xu
2025-09-30 10:27:52 -07:00
committed by GitHub
parent e6cd26c773
commit 3fa90735d5

View File

@@ -19,10 +19,10 @@ def crop_empty_inter_panel(img, direction: Literal["horizontal", "vertical", "bo
img_temp = img img_temp = img
if img.mode != 'L': if img.mode != 'L':
img_temp = ImageOps.grayscale(img) img_temp = ImageOps.grayscale(img_temp)
if background_color != 'white': if background_color != 'white':
img_temp = ImageOps.invert(img) img_temp = ImageOps.invert(img_temp)
img_mat = np.array(img) img_mat = np.array(img)