Settings

Theme

Convert photos to Atkinson dithering

gazs.github.io

438 points by nvahalik 6 months ago · 60 comments

Reader

JKCalhoun 6 months ago

Still my favorite B&W dither algorithm.

The university had a B&W flatbed scanner attached to a Mac running ... a Hypercard stack? that allowed you to scan an image and get a B&W image.

A clipart book I picked up from the college bookstore and a quick scan and I had a "logo" for the Mac shareware games I started writing in 1988 or so.

At the time I didn't;t realize how really ... nice .. Atkinson's algorithm is. But when, later, I tried dithering with other algos I saw how nice the diffusion was in Bill's code.

More recently I was playing with an eInk calendar project and wanted an "Atkinson-esque" series of images of the Moon in various phases. So I found a site very like the linked one to Atkinson-dither the moon photos I found [1].

[1] see the moon in screenshot: https://github.com/EngineersNeedArt/SystemSix/blob/10f2332b5...

  • dev_chhatbar 6 months ago

    That is honestly beautiful! Is there a place where I could see some of Bill's code? I would like to perhaps play around w it on my own time and learn a thing or two!

nedt 6 months ago

Don't click the "as follows" in the info dialog. Looks like this wasn't updated in a while and since then the link became NSFW.

throwanem 6 months ago

The implementation is excellent, and could be slightly improved by giving a default name and .png extension to the downloaded file, by passing a value to the "download" property on the anchor. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorE...

amai 6 months ago

Why not Sierra?

https://tannerhelland.com/2012/12/28/dithering-eleven-algori...

minorbug 6 months ago

Here's one I've been working on and off that lets you convert multiple images to MacPaint in a 400k MFS formatted disk image.

https://github.com/minorbug/mfsjs

I've had this project gathering a light layer of dust in my home directory for a couple months now. I used Gemini Deep Research to help produce the library, and I included the LLM-generated markdown for anyone who wishes to reproduce on other languages, improve upon it, etc.

  • kristianp 6 months ago

    > MacPaint images have a fixed format: 576 x 720 pixels resolution

    Were they really fixed? It says this on wikipedia, but there's no citation.

AndrewStephens 6 months ago

This implementation is great and the interface brings back memories.

I was wondering why my Atkinson dithering web-component[0] was getting more hits today - sad news. I’ve always thought that Atkinson dithering produces the nicest images on really crisp monitors like the original Mac - something about it just looks cool and 80s which is why I used it in a game last year.

[0] https://sheep.horse/2023/1/improved_web_component_for_pixel-...

  • kergonath 6 months ago

    Dithering at the pixel level on a retina screen is quite something. I quite like the style on some pictures, not so on others. They have a weird modern old-fashioned look and the individual dots are not as distracting as in actually old pictures.

    • AndrewStephens 6 months ago

      Thanks. I originally just wanted pixel-to-pixel dithering (quite difficult with modern browsers and retina class displays) but after I saw the results I knew I needed to add lower resolutions as well. It looks really good with some images, especially photos with lots of details - almost like a high-quality printed magazine. However you are right that the extra detail can be distracting to the eye.

  • shrinks99 6 months ago

    Woah cool web component!

amelius 6 months ago

If you want to do this in Python, there's:

https://github.com/tgray/hyperdither

kgbcia 6 months ago

Would be great for eink/epaper devices.

larodi 6 months ago

Is it the same Atkinson that died today and is this a tribute ?

  • zahlman 6 months ago

    In a sense, but the first commit in the repository was 15 years ago - it's not something that someone whipped up in response to the news.

    • larodi 6 months ago

      I adore dither as a tool for my designs. Kudos to Atkinson and everyone involved in the introduction of these algos. They mean a whole world of childhood to me, and a lot more.

      p.s. dithermark.com is super cool also.

  • throwanem 6 months ago

    Yes, he invented* the algorithm. One assumes it must be.

    * Corrected from 'discovered;' see below.

    • zahlman 6 months ago

      Invented the algorithm. The choice and arrangement of weights is a matter of fine-tuning to balance practical concerns - not some natural law of mathematics that could be figured out.

      • mark-r 6 months ago

        I would have thought such a simple combination would have been worked out much earlier. But I checked my 1993 copy of Robert Ulichney's "Digital Halftoning", and it only mentions 4. Floyd and Steinberg (1975), Jarvis, Judice, and Ninke (1976), Stucki (1981), and Stevenson and Arce (1985). Does anybody have a date for Atkinson's?

        • zahlman 6 months ago

          It was used on the Macintosh at release, so it must have predated Stevenson and Arce. I doubt that a description was formally published in the way that the others were. Wikipedia describes Atkinson's approach as a variant on Floyd-Steinberg dithering, and I imagine that he must have been aware of at least some of the prior work.

      • baq 6 months ago

        The algorithm, including the precious weights, can exist outside our universe. It doesn’t need matter, it only needs maths.

        Discovered is correct.

        • throwanem 6 months ago

          Bold to say anything "can exist outside our universe" as though one were in a position to know. Do you often visit the Realm of Forms?

          • baq 6 months ago

            Every single time when I talk to the librarian he takes me there - cheap, too, he only asks for some bananas.

      • 4b11b4 6 months ago

        That's a good clarification

      • throwanem 6 months ago

        I appreciate the correction.

franze 6 months ago

I wanted to learn a bit more about that algo, so https://atkinson.franzai.com/ - I double checked through some AIs so I hope it is factually correct.

RodgerTheGreat 6 months ago

A similar tool I wrote several years ago: http://beyondloom.com/tools/dith.html

ksr 6 months ago

Cute UI! GitHub link of demo: https://github.com/gazs/canvas-atkinson-dither

ddingus 6 months ago

I just converted my home stereo. Pioneer, so lots of brushed metal. It looks really great at 2560x1440. Great dither.

gcanyon 6 months ago

What am I doing wrong? I import a photo, I click save to desktop, and I get an unidentified file in an unknown format.

  • busymom0 6 months ago

    I believe the file is missing a name and extension. If you rename the file with .png extension, then it works.

    • gcanyon 6 months ago

      HA! For some reason it never occurred to me that it would be in a format the original Mac never knew. Thanks!

zdw 6 months ago

Interesting that one of the size options is 512x384, not 512x342 which was the original mac resolution.

deverman 6 months ago

Thanks I tried a bunch of my favorite photos in this too.

htk 6 months ago

Thank you for posting this. Very nostalgic!

corytheboyd 6 months ago

Very, very perfect, I love it

9d 6 months ago

Sorry but where did you get the JS/CSS for this? It's so small.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection