[HN Gopher] Lid - Lo-fi image dithering
       ___________________________________________________________________
        
       Lid - Lo-fi image dithering
        
       Author : ecliptik
       Score  : 76 points
       Date   : 2023-01-12 19:11 UTC (3 hours ago)
        
 (HTM) web link (rawtext.club)
 (TXT) w3m dump (rawtext.club)
        
       | xnx wrote:
       | Recently: Pixel Accurate Atkinson Dithering for Images in HTML
       | (32 comments) https://news.ycombinator.com/item?id=34052253
        
       | khobragade wrote:
       | Love these! Also check out Didder https://github.com/makeworld-
       | the-better-one/didder https://vladh.net/dithering
        
         | nilsb wrote:
         | Didder is fantastic. I'm using it to convert images to
         | grayscale for use with Waveshare e-ink displays. I've found no
         | other tool that both lets you specify a custom palette (without
         | which the resulting image looks pretty bad) and is reasonably
         | quick.
         | 
         | For future reference, this works beautifully with their 9.7"
         | display: didder --palette '000000 111111 222222 333333 444444
         | 555555 666666 777777 888888 999999 aaaaaa bbbbbb cccccc dddddd
         | eeeeee ffffff' -g -i - -o - edm --serpentine FloydSteinberg
        
           | sllabres wrote:
           | Image Alchemy [1] Unfortunately not longer available. But one
           | of the greatest image conversion software I know (including
           | most of the here described algorithm for dithering and some
           | more). And this feature set is from at least 25-30 years ago.
           | 
           | I'm always getting a bit nostalgia when I see these dithered
           | images and remember the time then with the fascination for
           | the opposite direction: 'true color... wow that would be
           | great' ;)
           | 
           | [1] https://www.handmadesw.com/products/image_alchemy.htm
        
       | phailhaus wrote:
       | Beautiful! One suggestion: it would be helpful to put the
       | original image first, so that people have context before seeing
       | it dithered.
        
       | danuker wrote:
       | Error diffusion is by far my favorite. Works while zooming out
       | also.
        
         | guidoism wrote:
         | It looks amazing. Honestly I'd rather see that in most books
         | than colored pics.
        
       | ethanwillis wrote:
       | If you want to do dithering there are lots more
       | variations(algorithms) on it with very very impressive results in
       | the resulting quality.
        
       | Kuraj wrote:
       | FYI, the images on the website are shrunk by a small factor which
       | messes up the dithering. They're best viewed in a new tab, or
       | with the website zoomed to 125% on a 96dpi setting.
        
         | rcthompson wrote:
         | Yes, the scaling induces visual artifacts that pretty
         | substantially misrepresent what each algorithm should look
         | like. (In particular it adds vertical and horizontal bars that
         | aren't on the actual image.) Definitely make sure you view the
         | images at the proper zoom level.
        
           | aliqot wrote:
           | You'd think they'd have foreseen that and just cropped their
           | examples to be pixel perfect for their own fixed width
           | content column.
        
             | AndrewStephens wrote:
             | That doesn't work either, since browsers don't respect
             | exact pixel sizes for elements even at 100% and at other
             | zoom settings all bets are off.
             | 
             | That is why I created this project[0], recently discussed
             | here[1]
             | 
             | [0] https://sheep.horse/2022/12/pixel_accurate_atkinson_dit
             | herin...
             | 
             | [1] https://news.ycombinator.com/item?id=34052253
        
               | aliqot wrote:
               | Doing the lord's work, thank you.
        
         | tofof wrote:
         | Yet another of many reasons in this thread for why dithering
         | photographs for the web is stupid.
        
       | fluoridation wrote:
       | As has been pointed out by others before, while dithering is
       | stylistic and useful for display in low color resolution screens,
       | dithered images compress poorly. You'll almost always get more
       | detail and color out of JPEG. At 30% quality I get a 43 KiB file,
       | and the difference is much less noticeable than if I had tried to
       | quantize down to two colors.
       | 
       | Now, if the point is aesthetics and not efficiency, by all means
       | use dithering.
        
         | tedunangst wrote:
         | In a sense, JPEG is fancy dithering. The DCT gives you a
         | dithering pattern customized for exactly the image you're
         | compressing, every dot placed to minimize error. (With some
         | hand waving.)
        
         | mikae1 wrote:
         | ...and when you compare the size of JPEG with AVIF[1], dithered
         | PNG may seem even more wasteful and pointless.
         | 
         | [1] https://afontenot.github.io/image-formats-
         | comparison/#abando...
        
         | bob1029 wrote:
         | > dithered images compress poorly
         | 
         | If you think about error diffusion dithering in particular on a
         | 1-bit palette - Information theory dictates that you are kind
         | of pushing entropy limits as-is. Compression is still possible,
         | but to get any kind of realistic gain it's going to have to be
         | slow compression.
         | 
         | Piping stuff like 1-bit dithered graphics through fast, lossy
         | JPEG/MPEG-style compressors (i.e. quantized DCT) will yield
         | absolute garbage results.
        
           | jarenmf wrote:
           | Could you please elaborate on the link of error diffusion to
           | information theory? as far as I understand error diffusion
           | minimizes the quantization error for lower frequencies on the
           | expense of adding more noise to higher frequencies. i.e it
           | seems to be only optimizing for human perception
        
             | bob1029 wrote:
             | You're right - in pure information theoretic terms there is
             | nothing special happening here. It's a tradeoff like
             | always. But, in human perceptual terms (i.e. how JPEG/MPEG
             | are designed), you may find substantial gain in _useful_
             | information per bit by applying dithering.
             | 
             | The useful amount of information represented by any given
             | bit of data is much larger in this arrangement. 1 bit = 1
             | entire pixel. In other schemes, you have upwards of 24 bits
             | representing the contents of 1 pixel. To human eyes, only 8
             | of these bits _really_ matter. You can usually throw away
             | 50% of the other 16 without anyone noticing.
        
       | sprash wrote:
       | This is interesting if you are after retro effects. State of the
       | art dithering however works with blue noise threshold textures[1]
       | because we have plenty of memory available these days. Here is a
       | nice comparison of all kinds of dithering algorithms that also
       | shows the clear superiority of blue noise dithering: [2].
       | 
       | 1.: http://momentsingraphics.de/BlueNoise.html
       | 
       | 2.: https://surma.dev/things/ditherpunk/
        
         | somat wrote:
         | A good forum post on the challenges of the "obra dinn" dither
         | effect in 3d.
         | 
         | https://forums.tigsource.com/index.php?topic=40832.msg136374...
        
       ___________________________________________________________________
       (page generated 2023-01-12 23:00 UTC)