4 ms·
To add to the above, an alternative dithering approach is error diffusion, e.g.: https://en.wikipedia.org/wiki/Floyd–Steinberg_dithering https://en.wikipedia.o
by WithinReason 4y ago
To add to the above, an alternative dithering approach is error diffusion, e.g.:
https://en.wikipedia.org/wiki/Floyd–Steinberg_dithering https://en.wikipedia.org/wiki/Floyd–Steinberg_dithering
The article mentions also doing this in the temporal domain.
- IIsi50MHz 4y agoAnd for 1-bit, Atkinson dithering can produce good effect. Floyd-Steinberg and Atkinson are the only two I'd usually consider for 1-bit dithering, with a preference for Atkinson for most images. Ordered dithering, even at 8-bit, is…not my cup of tea.
- makapuf 4y agoFor static images, yes. For animation, not so much as a pixel moving can have huge implications on other sides of the image due to error diffusion.
- bob1029 4y agoI find this to be the most elegant way to handle dithering. Been working with this on a side project. I've been looking to build an engine/game that approximates this art style: https://obradinn.com https://obradinn.com
- tomxor 4y ago> I find this to be the most elegant way to handle dithering Yes, it's so simple, it can be applied in a single pass on a single pixel buffer. Because in convolution kernel terms - it's only sampling from half of a moor neighbourhood, and that half can be from pixels not yet processed in the same buffer when moving through them in order. It's so simple it fits in a dweet ;P https://www.dwitter.net/d/24142 https://www.dwitter.net/d/24142 > I've been looking to build an engine/game that approximates this art style: https://obradinn.com https://obradinn.com Killedbyapixel took the above dweet for inspiration in the style of some of his proc gen art, although I haven't dug into the how yet. I suppose deeper game/object awareness integration could produce better results than merely piping the output of the renderer into the dither algorithm, perhaps even the rendering could be optimized by targetting dithering specifically. https://www.fxhash.xyz/generative/4686 https://www.fxhash.xyz/generative/4686
- bob1029 4y ago> perhaps even the rendering could be optimized by targetting dithering specifically. I was wondering about this possibility as well. I'm already up to my elbows in hand-rolled software rasterizer - which is already constrained to only using a luminance channel (8-bits). I suppose I could still accumulate dither error and do a one-pass, 1-bit raster by combining the world-space 256-level luminance information with whatever error information is in the accumulator.
- tomxor 4y ago> I suppose I could still accumulate dither error and do a one-pass, 1-bit raster by combining the world-space 256-level luminance information with whatever error information is in the accumulator. That would be interesting to see. I like the idea of renderers that give up things e.g resolution in exchange for something else. Pixel depth is just another. Would be interesting what gains in other areas might be possible if the rasterisation stage turns into 1-bit. Then again the cost of actually operating on single bit stored values might out weight any gains... unless this is done in hardware.
- bob1029 4y agoThink about it like this... In 1-bit dithered scheme, 1 machine word represents 64 entire pixels worth of values. You can access 64 pixels at a time and use bit-wise operations to manipulate the individual values. Compare to a typical 24-bit RGB array, you just reduced your full-scan array access requirements from 3 per pixel to 1/64 per pixel. For 720p (1280x720), you'd only be talking about 14,400 loop iterations to walk the entire frame buffer. You could almost get away without even compressing the frames in some applications. At 30fps, totally uncompressed, 720p 1-bit dither would come in right at 30 mbps.
- cwmoore 4y agoSurely you intended a Moore neighborhood and not moor? No relation.
- 4y ago
- adtac 4y agoOne more relevant use case: I've found Floyd-Steinberg dithering to be somewhat useful in compressing scanned JPEG paper notes at 600dpi (~1.5-2.5MB per page) to 1-bit PNG (100-300KB). At full scale, there is no loss in readability and in fact I think I prefer the aesthetic quality of the 1-bit PNG. However, at <50% zoom, the dithered version was way less readable than a 2-bit PNG of slightly higher file size, so I ended up not compressing to 1-bit. Edit: I was wrong, my (ex-) image viewer was at fault at 50% zoom. Viewing in other apps, the dithered version is visually no different from the 2-bit version. I bet the difference is even less with a HiDPI screen.
- Nick87633 4y agoThis sounds really interesting. Can you share some screenshots for us to see?