Logo elodees  elodees

A caring AI for a better world













Only alphabetic characters accented or not as well as the space are accepted

Logo IA




Floyd-steinberg algorithm





No account yet ?

Sign up to access all content




The Floyd-Steinberg algorithm is used in image processing.

The Floyd-Steinberg algorithm performs dithering by diffusing the quantization error of a pixel to its neighbors.



for each y from top to bottom do
        for each x from left to right do
                oldpixel := pixels[x][y]
                newpixel := find_closest_palette_color(oldpixel)
                pixels[x][y] := newpixel
                quant_error := oldpixel - newpixel
                pixels[x + 1][y ] := pixels[x + 1][y ] + quant_error × 7 / 16
                pixels[x - 1][y + 1] := pixels[x - 1][y + 1] + quant_error × 3 / 16
                pixels[x ][y + 1] := pixels[x ][y + 1] + quant_error × 5 / 16
                pixels[x + 1][y + 1] := pixels[x + 1][y + 1] + quant_error × 1 / 16

find_closest_palette_color(oldpixel) = round(oldpixel / 255)





     1


Dithering - GitHub













Welcome, my name is Eric Soupet and I am the administrator of the site elodees.com. elodees.com is a state of the art of Artificial Intelligence and aims to be collaborative, you can now offer content such as articles, events, tutorials, ... so don't hesitate !

Platform images credit : Pixabay - Pixabay License | Pexels - Pexels License