mirror of
https://github.com/ciromattia/kcc
synced 2026-07-14 08:46:10 +00:00
Apply the correct ordering for image processing (closes #33, thanks to @devernay)
This commit is contained in:
@@ -132,6 +132,8 @@ class ComicPage:
|
||||
self.image = ImageOps.autocontrast(Image.eval(self.image, lambda a: 255 * (a / 255.) ** gamma))
|
||||
|
||||
def quantizeImage(self):
|
||||
self.image = self.image.convert('L') # convert to grayscale
|
||||
self.image = self.image.convert("RGB") # convert back to RGB
|
||||
colors = len(self.palette) / 3
|
||||
if colors < 256:
|
||||
self.palette += self.palette[:3] * (256 - colors)
|
||||
|
||||
Reference in New Issue
Block a user