View Single Post
Old 02-04-2020, 04:33 PM   #39
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,819
Karma: 104541785
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by NiLuJe View Post
@BookCat: An eInk screen can only visibly display 16 shades of gray.

If you don't do anything particular, that means, for every shade that isn't exactly those, it'll take a (mathematical) knife, and choose instead one of those 16 colors (the closest to the actual, full range value).
i.e., quantization.
In practice, it'll mean stuff like gradients will change color very abruptly. The type of artifacts that creates is called "banding".

Dithering involves maths shenanigans to reduce the *effective* amount of different colors in the image to those same 16 colors, hopefully with the least amount of fidelity loss when perceived by the human eye. The screen can then just display them as-is.

In practice, on a Forma: https://github.com/koreader/koreader...ment-459955126

Original, full color: https://github.com/koreader/koreader...ment-459877277
Original, grayscale: https://github.com/NiLuJe/FBInk/pull...ment-580505556
Properly dithered: https://github.com/koreader/koreader...ment-459958068

I recommend viewing those with no zoom, because scaling algorithms will smooth dithering over.

(Some context: The Clara/Forma/Libra (& theoretically the PW4/KT4/Oasis 2/Oasis 3) can provide a fairly decent dithering algorithm for free, because what serves as as "GPU" in these things can now do it properly. Kobo is taking advantage of that fact. AFAICT, Amazon doesn't, possibly because they've been handling it differently for quite a while (i.e., preprocessed content, or on-device software dithering)).
I think you meant increase the effective number of different colors.

Attached is a 4 bit undithered conversion of your 8 bit grayscale image forced to 8 bit in case anybody has a broken PNG renderer. This shows what the image would look like on a 16 shade display with no dithering.

Code:
pngtopnm dither_test_gs.png | pnmdepth 15 | pnmdepth 255 | pnmtopng -force > undithered4bit.png
Attached Thumbnails
Click image for larger version

Name:	undithered4bit.png
Views:	100
Size:	85.9 KB
ID:	176907  
j.p.s is online now   Reply With Quote