1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-15 10:46:40 +00:00

webtoon increase minimum vertical blank space threshold

This commit is contained in:
Alex Xu
2025-10-20 10:53:10 -07:00
parent e0466ad040
commit 80ea17ff02

View File

@@ -105,8 +105,8 @@ def splitImage(work):
imgOrg = Image.open(filePath).convert('RGB') imgOrg = Image.open(filePath).convert('RGB')
# I experimented with custom vertical edge kernel [-1, 2, -1] but got poor results # I experimented with custom vertical edge kernel [-1, 2, -1] but got poor results
imgEdges = Image.open(filePath).convert('L').filter(ImageFilter.FIND_EDGES) imgEdges = Image.open(filePath).convert('L').filter(ImageFilter.FIND_EDGES)
# threshold of 8 is too high. 5 is too low. # threshold of 8 is too high. 5 is too low. 6 is OK but 7 is better
imgProcess = imgEdges.point(lambda p: 255 if p > 6 else 0).convert('1', dither=Dither.NONE) imgProcess = imgEdges.point(lambda p: 255 if p > 7 else 0).convert('1', dither=Dither.NONE)
widthImg, heightImg = imgOrg.size widthImg, heightImg = imgOrg.size
if heightImg > opt.height: if heightImg > opt.height:
@@ -120,7 +120,7 @@ def splitImage(work):
panels = [] panels = []
# check git history for how these constant values changed # check git history for how these constant values changed
h_pad = int(widthImg / 20) h_pad = int(widthImg / 20)
v_pad = int(widthImg / 80) v_pad = int(widthImg / 20)
if v_pad % 2: if v_pad % 2:
v_pad += 1 v_pad += 1
while yWork < heightImg: while yWork < heightImg: