This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://en.wikipedia.org/wiki/Floyd–Steinberg_dithering | |
from numba import jit | |
import numpy as np | |
@jit(nopython=True) | |
def floyd_steinberg(image): | |
# image: np.array of shape (height, width), dtype=float, 0.0-1.0 | |
# works in-place! | |
h, w = image.shape | |
for y in range(h): |