4 ms·
here's how my quantizer does: full-color, undithered, floyed-dithered: http://imgur.com/a/lrLTd#0 http://imgur.com/a/lrLTd#0 repo: https://github.com/leeoniya/
by leeoniya 12y ago
here's how my quantizer does: full-color, undithered, floyed-dithered: http://imgur.com/a/lrLTd#0 http://imgur.com/a/lrLTd#0
repo: https://github.com/leeoniya/RgbQuant.js https://github.com/leeoniya/RgbQuant.js
demos: http://o-0.me/RgbQuant/ http://o-0.me/RgbQuant/
this image is actually a pretty poor example of quantization, it's too easy. full color gradients give a much better indicator of behavior, quality and performance.
if you really are interested in different algorithms, check this out: http://www.codeproject.com/Articles/66341/A-Simple-Yet-Quite-Powerful-Palette-Quantizer-in-C http://www.codeproject.com/Articles/66341/A-Simple-Yet-Quite...
error-diffusion dithering explained (and kernels): http://www.tannerhelland.com/4660/dithering-eleven-algorithms-source-code/ http://www.tannerhelland.com/4660/dithering-eleven-algorithm...
- quotedmycode 12y agoThat is pretty amazing, thanks for sharing. I am interested in different quantization methods, if only for screenshot usage ( I am working on a remote control product, and the quantization used to be quite poor before I added in octree ). Of course, most of my code is in C# but I can at least take a look at the algorithms, and if they are MIT licensed, I can see what it would take to convert them.
- j_s 12y agonQuant is a quantizer in C#, Apache licensed http://nquant.codeplex.com/ http://nquant.codeplex.com/
- leeoniya 12y agoWu v2 is probably the best hands-off quantizer that I have seen. It's not the fastest and probably too resource intensive for embedded apps, but it is remarkably good. I would recommend it (or anything based on it) without hesitation. I'm actually in the process of porting it to js using typed arrays and possibly WebGL/GLSL. You can compile it pretty easily to asm.js for max pure-js perf via Emscripten, but I don't know how clean its API/interface will be and if it will leak globals based on how the code is structured [1] [1] http://www.ece.mcmaster.ca/~xwu/cq.c http://www.ece.mcmaster.ca/~xwu/cq.c
- semi-extrinsic 12y agoI once won a code golf "popularity contest" competition that was about dithering a grayscale image. The algorithm was perhaps interesting. More so my language of choice: Fortran. http://codegolf.stackexchange.com/questions/26554/dither-a-grayscale-image http://codegolf.stackexchange.com/questions/26554/dither-a-g...
- nitrogen 12y agoInterestingly, both of the quantized versions appear slightly brighter in all colors than the original. It's easier to see in the dithered image, but also visible in the undithered image.