5 ms·
I guess the alternative would be to compute everything in greyscale and use Floyd-Steinberg [0] or some other dithering algorithm to convert it to 1-bit color.
by 0-_-0 5y ago
I guess the alternative would be to compute everything in greyscale and use Floyd-Steinberg [0] or some other dithering algorithm to convert it to 1-bit color.
[0]: https://en.wikipedia.org/wiki/Floyd%E2%80%93Steinberg_dithering https://en.wikipedia.org/wiki/Floyd%E2%80%93Steinberg_dither...
- rualca 5y agoThank you for pointing to Wikipedia's article on Floud-Steinberg. Cool stuff!
- 0-_-0 5y agoYou're welcome, there are many others: https://en.wikipedia.org/wiki/Dither#Algorithms https://en.wikipedia.org/wiki/Dither#Algorithms
- msephton 5y agoOriginally I was using greyscale and dithering (I have another bespoke tool for exploring a dozen or so dithering algorithms) but the results were less than ideal. Dithering works great at larger sizes, but with my final sprites being only 30x30px (much, much smaller than the example images in the blog post) the results were a mess. After the exploration with greyscale, as the blog post hopefully explains, I moved from to pulling out black and white separately - which gave better results - to this RGB Channel approach to generate the masks more easily. I have headroom to squeeze another colour by using the alpha channel as the base colour and using the free colour for some other detail. But so far I've not needed to. Though good to know it's there if I need it to be!