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

always convert to L

even if workImg.color = False, it could still have color pixels, which can cause problems with quantization
This commit is contained in:
Alex Xu
2025-06-27 07:19:22 -07:00
committed by GitHub
parent 16a1d9b45f
commit 3e4b729a30

View File

@@ -359,8 +359,7 @@ class ComicPage:
self.image = self.image.convert('L') self.image = self.image.convert('L')
def quantizeImage(self): def quantizeImage(self):
if self.color: self.image = self.image.convert("L").convert("RGB")
self.image = self.image.convert("L").convert("RGB")
palImg = Image.new('P', (1, 1)) palImg = Image.new('P', (1, 1))
palImg.putpalette(self.palette) palImg.putpalette(self.palette)
self.image = self.image.quantize(palette=palImg) self.image = self.image.quantize(palette=palImg)