h(0,0)=0:h(1,0)=-1:h(2,0)=7/16
h(0,1)=3/16:h(1,1)=5/16:h(2,1)=1/16
dither_bw img1, img2, 0.1, h()
dither img1, img3, 2, h()
dither img1, img4, 4, h()
h(0,0)=0:h(1,0)=0:h(2,0)=-1:h(3,0)=7/48:h(4,0)=5/48
h(0,1)=3/48:h(1,1)=5/48:h(2,1)=7/48:h(3,1)=5/48:h(4,1)=3/48
h(0,2)=1/48:h(1,2)=3/48:h(2,2)=5/48:h(3,2)=3/48:h(4,2)=1/48
dither_bw img1, img5, 0.1, h()
dither img1, img6, 2, h()
dither img1, img7, 4, h()
h(0,0)=0:h(1,0)=-1:h(2,0)=1/8:h(3,0)=1/8
h(0,1)=1/8:h(1,1)=1/8:h(2,1)=1/8:h(3,1)=0
h(0,2)=0:h(1,2)=1/8:h(2,2)=0:h(3,2)=0
dither_bw img1, img8, 0.1, h()
dither img1, img9, 2, h()
dither img1, img10, 4, h()
'colour dither
'source image, destination image, number of colours per channel, diffusion matrix
r
= (_red(z
)*num\
255)*255\num
g
= (_green(z
)*num\
255)*255\num
b
= (_blue(z
)*num\
255)*255\num
conv_ed img2, x, y, h(), qr, qg, qb
'black and white dither
'source image, destination image, bw threshold percent, diffusion matrix
conv_ed img2, x, y, h(), qr, qg, qb
xx = x
yy = y
r
= _red(point(x0
-xx
+x
, y0
-yy
+y
)) + qr
*h
(x
,y
)