View Single Post
Old 01-09-2015, 09:44 AM   #208
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
First of all, sorry for digging up a relatively stale thread... .

Given the terrible rendering of covers in sleep mode, I quickly enabled the "B&W Covers" setting, but when that didn't help much, I took a look at the code: it basically just does what's on the tin, without dithering it down to the eInk 16 shades of grey palette.

Since I was in a hurry, I took a very dirty approach and applied this simple patch to the Calibre sources:

Code:
diff --git a/src/calibre/utils/magick/draw.py b/src/calibre/utils/magick/draw.py
index 73832a1..d0793c4 100644
--- a/src/calibre/utils/magick/draw.py
+++ b/src/calibre/utils/magick/draw.py
@@ -75,6 +75,7 @@ def save_cover_data_to(data, path, bgcolor='#ffffff', resize_to=None,
 
     if grayscale:
         img.type = "GrayscaleType"
+        img.quantize(number_colors=16, dither=1)
         changed = True
 
     if resize_to is not None:
It's dirty as hell, but it appears to be doing the job just fine. (Granted, the quantization step is expensive and appears to block the GUI, but, it works, I can now look at book covers without making my eyes bleed ;p).

I'm basically just throwing the idea out there to see if there's a way to handle that more gracefully .

[Granted, my opinionated position on this issue most likely stems from the pains I took to do it right with the Kindle's ScreenSavers hack ]
NiLuJe is offline   Reply With Quote