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:
@@ -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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user