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

Fix quantization for colored images (#991)

This commit is contained in:
Adrian
2025-06-26 17:36:22 +03:00
committed by GitHub
parent b7aef324aa
commit 16a1d9b45f

View File

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