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

fix webtoon panel detection (#1111)

This commit is contained in:
Alex Xu
2025-10-14 12:51:40 -07:00
committed by GitHub
parent 28ec2d23fc
commit dc8136f6fd

View File

@@ -23,7 +23,7 @@ import sys
from argparse import ArgumentParser
from shutil import rmtree, copytree, move
from multiprocessing import Pool
from PIL import Image, ImageChops, ImageOps, ImageDraw
from PIL import Image, ImageChops, ImageOps, ImageDraw, ImageFilter
from .shared import dot_clean, getImageFileName, walkLevel, walkSort, sanitizeTrace
@@ -101,7 +101,9 @@ def splitImage(work):
Image.warnings.simplefilter('error', Image.DecompressionBombWarning)
Image.MAX_IMAGE_PIXELS = 1000000000
imgOrg = Image.open(filePath).convert('RGB')
imgProcess = Image.open(filePath).convert('1')
# I experimented with setting dither=None, but got very poor results
# The default dither is good
imgProcess = Image.open(filePath).filter(ImageFilter.FIND_EDGES).convert('1')
widthImg, heightImg = imgOrg.size
if heightImg > opt.height:
if opt.debug: