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

don't autocontrast color content (#1021)

This commit is contained in:
Alex Xu
2025-07-09 13:59:54 -07:00
committed by GitHub
parent bc98eecae9
commit a79c740387
2 changed files with 16 additions and 10 deletions

View File

@@ -639,21 +639,22 @@ def imgFileProcessing(work):
workImg = image.ComicPageParser((dirpath, afile), opt)
for i in workImg.payload:
img = image.ComicPage(opt, *i)
is_not_color = not opt.forcecolor or not img.color
if is_not_color:
img.convertToGrayscale()
if opt.cropping == 2 and not opt.webtoon:
img.cropPageNumber(opt.croppingp, opt.croppingm)
if opt.cropping == 1 and not opt.webtoon:
img.cropMargin(opt.croppingp, opt.croppingm)
if opt.interpanelcrop > 0:
img.cropInterPanelEmptySections("horizontal" if opt.interpanelcrop == 1 else "both")
img.autocontrastImage()
img.gammaCorrectImage()
if is_not_color:
img.autocontrastImage()
img.resizeImage()
img.optimizeForDisplay(opt.reducerainbow)
if opt.forcecolor and img.color:
pass
elif opt.forcepng:
if is_not_color and opt.forcepng:
img.quantizeImage()
else:
img.convertToGrayscale()
output.append(img.saveToDir())
return output
except Exception: