12 comments

  • geon 4 hours ago ago

    Funny. I referenced this exact article yesterday and implemented N-Closest.

    There was a surprising amount of parameters to fiddle with. Especially since I experimented with adjusting the N depending on the distance of the matches.

    I wanted to implement ordered dithering to convert images to the c64.

    I think dithering looks best when there are only 2 colors involved the mix, but the palette is a bit wonky so a lot of colors are hard to represent well.

    An issue I noticed was that when the top 2 candidates in a gradient flipped from A,B to B,A as the gradient moved closer to B, was that the checker pattern would get an ugly seam of double pixels, like ABABABBABABA.

    I’ll experiment more with manually selecting pairs of colors that mix well and generate gradient ramps from them. Then I can pre-quantize the image and use a predetermined dither pattern for each mix. Should also allow for more artistic control.

  • yehoshuapw 3 hours ago ago

    Matt Parker video about dithering, worth a watch:

    https://m.youtube.com/watch?v=kT4p1GXq4HY

  • anArbitraryOne 4 hours ago ago

    I love dithering in a platonic way

  • vardump 7 hours ago ago

    Are there other uses remaining for ordered dithering than retro look and perhaps e-ink?

    • kqr 23 minutes ago ago

      Any time you want a sequence to be deterministic, seem familiar, and also have a roughly even mix of element types. Think shuffling playlists, ordering search results, etc.

    • chmod775 4 hours ago ago

      Light sources in video games and such. If you have a light source with a very large falloff range illuminating a large area, you'll have noticable steps in the gradient.

      Ordered dithering is a very cheap solution to this.

      • account42 10 minutes ago ago

        Wouldn't random noise be a more appropriate solution in that case?

    • Kalabasa 2 hours ago ago

      In video games or graphics, dithering can be an alternative to transparency. It's more performant too. I see this a lot in handheld consoles.

      As screen resolution and density increases, dithering could even replace transparency as long as you don't look close enough.

    • the8472 5 hours ago ago

      Shallow color gradients (e.g. blue sky or anime) result in visible banding on 8bpc displays, which is a large fraction of displays. Ordered dithering is GPU-friendly, so it's useful to reduce higher-bpc content to those display formats without introducing banding.

    • krapht 7 hours ago ago

      Lots of sensors these days will give you 10 or 12 bits of data per color channel. You may want ordered dithering when previewing on an 8 bit display.

    • 0xMalotru 7 hours ago ago

      Yep e-ink is a good practical use. In fact any system with black and white display use ordered dithering when they want to draw images

      • Lerc 5 hours ago ago

        I would think that it would only be beneficial on devices that don't maintain a full frame rendering buffer or if they wanted to do partial updates.

        If the full frame is maintained with more values then quite a lot of things like Floyd Steinberg optimize well enough to be integrated with a full frame update.