3 ms·
> in theory changing a single pixel at the top left of the image could cause a chain reaction that could force the whole image to be re-dithered. My thought is
by JKCalhoun 2y ago
> in theory changing a single pixel at the top left of the image could cause a chain reaction that could force the whole image to be re-dithered.
My thought is to store the error for each pixel in a separate channel. When a portion of the bitmap is "dirtied" you could start in the top left of the dirty rectangle, re-Atkinson until, once outside the dirty rect, you compute the same error as the existing error for a given pixel. At that point there would follow the same dither pattern and you can stop.
As you say, it's conceivable you would have to go to the very end of the document. If the error is an integer though I feel like you would hit a point where you can stop early. Maybe I am misunderstanding how error diffusion works or grossly misjudging how wild mismatched the before/after errors would be.
- itishappy 2y agoNeat idea, be curious to see it implemented! You can probably get away with just stopping at the bounds of the dirty area. Sure, the error would accumulate, but they'd be localized to a single pixel. I doubt it would be visible. One issue I suspect you'll encounter is that redrawing a restricted area during movement will cause that area to flicker weirdly while the rest of the image stays relatively stable.