1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-12 17:26:23 +00:00

ignore 2% of pixels near edges and don't crop more than 10% per edge (#1044)

* max crop and ignore edges

* make edge_bbox neater
This commit is contained in:
Alex Xu
2025-07-26 07:26:10 -07:00
committed by GitHub
parent 27296565a3
commit 06e2ee2968
2 changed files with 19 additions and 0 deletions

View File

@@ -429,6 +429,10 @@ class ComicPage:
bbox = get_bbox_crop_margin(self.image, power, self.fill)
if bbox:
w, h = self.image.size
left, upper, right, lower = bbox
# don't crop more than 10% of image
bbox = (min(0.1*w, left), min(0.1*h, upper), max(0.9*w, right), max(0.9*h, lower))
self.maybeCrop(bbox, minimum)
def cropInterPanelEmptySections(self, direction):