From e2b98db1a2f6e7f43d91f8ddd8f1e744dd41b99e Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Thu, 16 Oct 2025 22:04:24 -0700 Subject: [PATCH] fix webtoon perf_counters --- kindlecomicconverter/comic2panel.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/kindlecomicconverter/comic2panel.py b/kindlecomicconverter/comic2panel.py index e1fc5b0..5dc7104 100644 --- a/kindlecomicconverter/comic2panel.py +++ b/kindlecomicconverter/comic2panel.py @@ -23,7 +23,6 @@ import sys from argparse import ArgumentParser from shutil import rmtree from multiprocessing import Pool -from time import perf_counter from PIL import Image, ImageChops, ImageOps, ImageDraw, ImageFilter from PIL.Image import Dither from .shared import dot_clean, getImageFileName, walkLevel, walkSort, sanitizeTrace @@ -103,15 +102,9 @@ def splitImage(work): Image.warnings.simplefilter('error', Image.DecompressionBombWarning) Image.MAX_IMAGE_PIXELS = 1000000000 imgOrg = Image.open(filePath).convert('RGB') - start = perf_counter() imgEdges = Image.open(filePath).convert('L').filter(ImageFilter.FIND_EDGES) - end = perf_counter() - print(f"webtoon: imgEdges {end - start} sec") - start = perf_counter() # the threshold of 8 is conservative. 0-6 are definitely not edges imgProcess = imgEdges.point(lambda p: 255 if p > 8 else 0).convert('1', dither=Dither.NONE) - end = perf_counter() - print(f"webtoon: imgProcess {end - start} sec") widthImg, heightImg = imgOrg.size if heightImg > opt.height: