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

Fixes to grayscale pages in forcecolor mode (#978)

* Fix bit depth of non-color pages in forcecolor mode

* Optimization for JPEG non-color pages in forcecolor mode
This commit is contained in:
Adrian
2025-06-19 01:12:12 +03:00
committed by GitHub
parent 2fa90c9f59
commit e9f0310b94
2 changed files with 8 additions and 4 deletions

View File

@@ -642,8 +642,8 @@ def imgFileProcessing(work):
img.autocontrastImage()
img.resizeImage()
img.optimizeForDisplay(opt.reducerainbow)
if opt.forcepng and not opt.forcecolor:
img.quantizeImage()
if not opt.forcecolor or (opt.forcecolor and not workImg.color):
img.convertToGrayscaleOrQuantize()
output.append(img.saveToDir())
return output
except Exception: