0

I implemented a version of the Dithering algorithm in Python (from Image Processing). The algorithm that I used is the Floyd Steinberg algorithm.

I was wondering how the images would change if I will rerun my algorithm on the same image over and over, repeatedly. I noticed that it didn't change at all:

First iteration:

enter image description here

10th iteration:

enter image description here

First of all, is it the correct behavior or something is up with my implementation? It it's correct, I was wondering why after one iteration, it does not do change to the image at all? Is there some math-explanation behind it?

vesii
  • 2,760
  • 4
  • 25
  • 71
  • Dithering turns an image with many different colors into an image with only a few. After applying the algorithm, your image has only a few colors. If you apply the algorithm again, all the pixels already are one of the few colors it outputs, so there is nothing left to change. – Cris Luengo Oct 30 '21 at 17:48
  • FS was the error "diffusion" thing, right? so it's quantizing a pixel's colors and pushing the error into the next pixel... but if it's already quantized, there is zero error to push along. -- also, I think your Lena is mirrored. – Christoph Rackwitz Oct 30 '21 at 18:04

1 Answers1

1

Yes, it is the correct behavior.

And the reason why repeating the same algorithm does not change the image is:

This algorithm simplify the image so it try to change the color of the pixel to the nearest color from a small colors set. So if the pixel color becomes equal to a Cor from the small colors set, then it is the nearest color to itself and will remain unchanged.

user16930239
  • 6,319
  • 2
  • 9
  • 33