from kandinsky import set_pixel from math import ceil def dithering_ign_numworks(): for y in range(222): for x in range(320): p_x = ceil(x * .5) p_y = ceil(y * .5) noise = (52.9829189 * ((0.06711056 * p_x + 0.00583715 * p_y) % 1)) % 1 threshold = p_y / 111 color = (0, 0, 0) if noise < threshold else (255, 255, 255) set_pixel(x, y, color) dithering_ign_numworks()