There is very good article about others dithering algorithms:
http://www.tannerhelland.com/4660/dithering-eleven-algorithms-source-code/ It even mention static dithering.
But I want to disagree over the way they implemented error partitioning to distribute it among neighbouring pixels: they are dividing the error, then multiplying it and then adding to neighbours. Using integer arithmetics this leads to relatively big errors producing that can be reduced by first multiplying and only then dividing. But this approach has the same error source, namely discading remainder after division, it's just not multiplied further. Taking into account constrants put in the problem it will be much better to calculate all the remainders and put them in one or more pixels. Just compare the following:
{
error1 = 1 * (error / 16);
error3 = 3 * (error / 16);
error5 = 5 * (error / 16);
error7 = 7 * (error / 16);
}
{
error1 = (1 * error) / 16;
error3 = (3 * error) / 16;
error5 = (5 * error) / 16;
error7 = (7 * error) / 16;
}
{
error1 = (1 * error) / 16;
error -= error1;
error3 = (3 * error) / 15;
error -= error3;
error5 = (5 * error) / 12;
error -= error5;
error7 = (7 * error) / 7;
}
Edited by author 17.01.2018 15:59