sh:-1_#'*:\ B:(0 2;3 1) mtx:{(*/(x+1)#4;x{,/,'/'x+\:\:4*y}[B]/B)} / (factor;Bayer matrix) dth:{(f;m):x;(h;w):sh y;((h#w#/:m)%f)>y} / [[https://en.wikipedia.org/wiki/Ordered_dithering]]