@thi.ng/pixel-dither
Version:
Extensible image dithering w/ various algorithm presets
25 lines (24 loc) • 323 B
JavaScript
const DIFFUSION_ROW = {
ox: [1],
oy: [0],
weights: [1],
shift: 0
// x2: width - 1,
};
const DIFFUSION_COLUMN = {
ox: [0],
oy: [1],
weights: [1],
shift: 0
};
const DIFFUSION_2D = {
ox: [1, 0],
oy: [0, 1],
weights: [1, 1],
shift: 1
};
export {
DIFFUSION_2D,
DIFFUSION_COLUMN,
DIFFUSION_ROW
};