9 ms·
Ditherpunk 2 – beyond 1-bit
- keyle 6y agoMaybe it's a product of age, but I find dithering increasingly sexy.
- durakot 6y agoDithering was always sexy.
- makeworld 6y agoDoesn't it look cooler now because it's "retro"? I'm sure the people who were forced to use it for hardware reasons would've loved to have all 24 bits available to them.
- yesenadam 6y agoPrimitive/retro looking cool reminds me of Veblen on the "exaltation of the defective": "...the cheap, and therefore indecorous, articles of daily consumption in modern industrial communities are commonly machine products; and the generic feature of the physiognomy of machine-made goods as compared with the hand-wrought article is their greater perfection in workmanship and greater accuracy in the detail execution of the design. Hence it comes about that the visible imperfections of the hand-wrought goods, being honorific, are accounted marks of superiority in point of beauty, or serviceability, or both. Hence has arisen that exaltation of the defective, of which John Ruskin and William Morris were such eager spokesmen in their time; and on this ground their propaganda of crudity and wasted effort has been taken up and carried forward since their time. And hence also the propaganda for a return to handicraft and household industry. So much of the work and speculations of this group of men as fairly comes under the characterisation here given would have been impossible at a time when the visibly more perfect goods were not the cheaper." – Thorstein Veblen, The Theory of the Leisure Class, 1899, p162
- dehrmann 6y agoPosterizing, which I guess is a type of low-bit dithering, or not dithering at all, has been popular of a long time. There's the famous Obama "Hope" poster with him in front of a French flag that was really popular in 2008.
- durakot 6y agoPosterizing is fine but dithering is an art unto itself.
- ObsoleteNerd 6y agoDithering has always given me the most incredibly overwhelming nostalgia, to the point where it’s emotionally moving. No doubt because my first computer was a Macintosh SE and it tickles all the right memories, but there’s something more to it, the technical impressiveness of how damn well it works to add realism with so few colours.
- mjhagen 6y agoSoft Dorothy agrees.
- news_to_me 6y agoDithering is so cool! I love the different looks you can get with different algorithms. I added dithered output to a little 3D renderer I’m building and I think it looks super cool [0]. Also, it’s mentioned in the monochrome article, but Lucas Pope’s post on dithering in Obra Dinn is one of my favorite tech explorations [1]. [0] https://twitter.com/zackmichener/status/1359989840360525827?s=21 https://twitter.com/zackmichener/status/1359989840360525827?... [1] https://forums.tigsource.com/index.php?PHPSESSID=dreqnu2pikndobb5pafl2nvqs4&topic=40832.msg1363742#msg1363742 https://forums.tigsource.com/index.php?PHPSESSID=dreqnu2pikn...
- kelsolaar 6y agoGlad to see you finally came to an end with that. Thanks for the plug btw! :)
- Shared404 6y agoSide note: I was poking around your website, and that has to be my favorite way of obfuscating an email I've seen yet.
- makeworld 6y agoGlad someone noticed :) I got it from some else's personal site that's offline now, and definitely keeps the bots away. Some humans too.
- ktpsns 6y agoI also love your "profile" picture on https://www.makeworld.gq/about/ https://www.makeworld.gq/about/ , which is actually https://thispersondoesnotexist.com/image https://thispersondoesnotexist.com/image :D
- doublerebel 6y agoRegarding the lack of info on "clustered dot" matrices, it may just be a keyword issue. This pattern is traditionally called "halftone" and comes from the limitations of print design. I've done some graphics programming but never specifically for halftone patterns, a quick search turns up this SO post with some examples: https://stackoverflow.com/questions/1258047/algorithm-to-make-halftone-images https://stackoverflow.com/questions/1258047/algorithm-to-mak... Thanks for the cool article! Coming from print and early graphics, I know dithering is all around us even if we don't notice it.
- makeworld 6y agoMy understanding is that while "halftone" is an older term now, there was an in-between period where it meant any kind of dithering. Indeed, even on the page you linked you see people talking about Floyd-Steinberg and other kinds of dithering. Thanks for the link, although the best I could find was this[1] old Java file that's completely uncommented. I was hoping for some textual documentation. 1: https://github.com/gabrielarchanjo/marvin-framework/blob/f5008c70859198b80bb430f97aa1db9c66c9548e/marvinproject/dev/MarvinPlugins/src/org/marvinproject/image/halftone/circles/Circles.java https://github.com/gabrielarchanjo/marvin-framework/blob/f50...
- Terretta 6y agoThe StackOverflow answer above is referenced by various Python halftoning projects, which have documented or at least commented halftone code you may be interested in: https://github.com/ClayFlannigan/halftone https://github.com/ClayFlannigan/halftone https://github.com/philgyford/python-halftone https://github.com/philgyford/python-halftone I think grandparent post is right, that you’re looking for the terms like halftone, halftoning, digital halftoning, binary halftoning, and the like. These are the terms that show up in papers: https://www.sciencedirect.com/science/article/abs/pii/S1047320312001447 https://www.sciencedirect.com/science/article/abs/pii/S10473... Text discussion at Wikipedia: https://en.wikipedia.org/wiki/Halftone https://en.wikipedia.org/wiki/Halftone Having worked in early digital press, I recall the term of art for a higher quality technique that came after “halftone screening” or “digital halftone” was “stochastic screening”: https://en.wikipedia.org/wiki/Stochastic_screening https://en.wikipedia.org/wiki/Stochastic_screening This prevented the tell-tale circle effect (moiré or rosette patterns) of traditional screening. We used it to print high quality magazine photography. It also worked on Mac Plus for rendering photography as a better dither for black and white dots of irregular or non-geometric photography — which brings us full circle to dithering. Using terms from Photoshop of the day, Pattern Dither uses a uniform pattern to represent levels of gray. Diffusion Dither uses a random pattern to represent levels of gray. Halftone Screen uses preset patterns (round, diamond, ellipse, line, square or cross) at frequencies and angles that can be varied as well. That brought another term to mind, “stippling”: https://github.com/joeedh/BlueNoiseStippling https://github.com/joeedh/BlueNoiseStippling Some more terms show up in this discussion on difference between halftoning and dithering: https://photo.stackexchange.com/questions/5779/what-is-the-difference-between-halftoning-and-dithering https://photo.stackexchange.com/questions/5779/what-is-the-d... --- ADDED: See also (PDF links may take a very long time to load): Grayscale Digital Halftoning using Optimization Techniques: http://ethesis.nitrkl.ac.in/7814/1/2015_Grayscale_Lalitha.pdf http://ethesis.nitrkl.ac.in/7814/1/2015_Grayscale_Lalitha.pd... Evaluation Tool for Halftoning Algorithms: https://www.idc.ac.il/en/schools/cs/research/documents/evaluation%20tool%20for%20halftoning%20algorithms%202015.pdf https://www.idc.ac.il/en/schools/cs/research/documents/evalu...
- mark-r 6y agoWhen you're doing color error diffusion dithering, you have to make sure the edges and corners of the color space are in your output palette. Otherwise you may get errors that accumulate and can't be eliminated.
- makeworld 6y agoThanks, I didn't know about this! Do you have any links to learn more? In any case, this is on the dev who uses the library and specifies a palette rather than the library itself though.
- mark-r 6y agoSorry, I don't have any links - I learned it through personal experience. Kept getting ugly blotches in the output that weren't easily explained. Finally traced it to errors that were accumulating because the palette color they were mapped to left an even greater positive error.
- lukevp 6y agoMy receipt printer library[0] uses dithering for images since the printers are black and white but fairly high resolution. It looks pretty decent [1], much better than a plain black and white conversion. I learned about dithering while implementing this library, and it’s a great technique! I originally implemented a black and white filter and then Floyd-steinberg dither natively in c# but then ended up using a library for it since we needed image transforms as well. [0]: https://github.com/lukevp/ESC-POS-.NET https://github.com/lukevp/ESC-POS-.NET [1]: https://user-images.githubusercontent.com/59696671/106924665-4a94bf80-66dd-11eb-93a5-992799a77712.jpg https://user-images.githubusercontent.com/59696671/106924665...
- sitkack 6y agoI got you 123 Fake St! That is a pretty sweet printer. Is it the Adafruit one?
- lukevp 6y agoI use an Epson printer[0] for developing the library, but this print out was from a contributor who’s trying to add support for the CUSTOM brand of receipt printers. If you have the Adafruit, please give the lib a try and let me know! It works on raspberry pis too. [0]: https://www.amazon.com/Epson-TM-T20II-Direct-Thermal-Printer/dp/B00HEMOOE0 https://www.amazon.com/Epson-TM-T20II-Direct-Thermal-Printer...
- zimpenfish 6y agoAh, that 3rd image reminds me of trying to send images to my ESC-POS darling. I think I've got an entire roll of garbage from Linux Bluetooth glitches corrupting the output (macOS works 100% reliably on the same binary stream.) Will definitely try this library.
- lukevp 6y agoAwesome, please do try it and let us know how it goes. As for the garbage, gotta have the hand on that power button so you can flip it off quickly when it starts scrolling garbage, it can really burn through paper quick!
- mikewhy 6y agoCluster dot dithering reminds me of this old tool: https://rasterbator.net/ https://rasterbator.net/
- dehrmann 6y agoDithering reminds me a bit of this one-bit audio format. It's at over 2.8 MHz, so Neil Young should be all over it. https://en.wikipedia.org/wiki/Direct_Stream_Digital https://en.wikipedia.org/wiki/Direct_Stream_Digital
- Synaesthesia 6y agoAlways wanted to hear that and see if it really is superior to CD audio.
- alias_neo 6y agoIn my experience, I've been unable to detect any discernable difference compared to other 16bit or 24bit Hi-Res audio at 44.1 or 96KHz. What _is_ totally discernable is the file sizes in the gigabytes ranges as opposed to tens of megabytes for equivalent 44.1/96KHz flacs. Ive found this a good resource for comparison: http://www.2l.no/hires/ http://www.2l.no/hires/
- deadlyllama 6y agoCGA had a green / red / yellow mode (320x200), but never saw anything as well dithered on it!
- MayeulC 6y ago> You can factor out the observer [the human] because what you are interested in here is basically energy conservation. I would tend to disagree from a theoretical perspective, as you are trying to conserve energy from the point of view of the observer. Our perception is not linear. The dithered images in the article appear too bright to me, probably due to the Helmholtz-Kohlrausch effect. Likewise, green is a lot brighter than other colors to us, and we have a greater depth of perception, so it might be more important to propagate errors there?
- codeflo 6y agoAs another commenter has noted, the most likely reason for that is missing gamma correction. An sRGB value of 128 is dithered as 50% black, 50% white, when it should be around 78% black, 22% white.
- makeworld 6y agoNo, the article and the library does gamma correction, and I've observed the exact effect you're talking about before. I'm not sure why the images are appearing too bright for the person above. Maybe because it's using pure colours like red and green which are bright on RGB displays? I should've chosen a different palette.
- codeflo 6y agoThat’s what I get for parroting claims I haven’t verified! That’s great, thanks for the correction. Hmm, as far as I understand the math, your palette being pure colors shouldn’t really matter if the display calibration were perfect. Which I guess is an unrealistic expectation. :)
- MayeulC 6y agoOf course, my monitor isn't calibrated ^^" However, pure red will always appear brighter than non-pure red, even at the same luminance (~energy), which is what Helmholtz-Kohlrausch is about. IIRC pure red appears brighter than other pure colors as well at the same luminance level, but I am not sure how computer monitors interact will all of the above...
- jpap 6y agoThis post covers a topic I've spent some time with in the past, and is generally a good overview but unfortunately gets the idea of "linear RGB" wrong. That means all of the results need some attention, including the Go implementation. Maybe for a part II post? Each color value (e.g. red) is represented by a value from zero to full intensity. It's easiest to think of it as a number between 0 and 1 in a linear space. You could use a floating point number for that, or a quantized/fixed point value. For example the 10-bit quantized value round(r_linear*1023) in the range 0 to 0x3ff. 8-bit RGB color components are "encoded" from their linear version with a transfer curve (aka gamma compression). For sRGB, the curve is a piecewise linear and exponential combination. A good overview is [1]. There are many different encodings, including sRGB, BT.601, BT.709, etc. Then there's "full range" vs. "video range"... it can get complex pretty quickly. Because of gamma encoding, an 8-bit R_sRGB red value is not equal to round(r_linear*255). You have to first compress r_linear via the gamma curve, then quantize that 0..1 value to 8-bits. When going in reverse (expanding an 8-bit sRGB value to linear), you generally take R_sRGB/255 to produce a value in the 0..1 range and then use the inverse gamma curve to get the linear value. These computations can be done in floating point, fixed point, or using lookup tables. The takeaway is that you can't represent 8-bit sRGB color components in linear with just 8-bits, without losing precision. You need at least 12-bits for linear sRGB and many implementations just go straight for 32-bit float values for simplicity. These conversions are required whenever you combine (blend) pixels encoded into sRGB: so for each pixel operation X, you decode sRGB to linear, perform X, then encode back to sRGB. It's expensive! That's why GPUs offer texture formats that specify a gamma encoding like sRGB, so a pixel shader can blissfully work in linear color, with the conversions done for it in hardware as a pre- and post-shader operation. On the CPU? You have to do it all yourself... Because of that, many software libraries don't bother with the proper gamma conversion and just compute everything in the logarithmic (gamma encoded) domain. And most of the time, it looks OK! But it really is just a "cheap" approximation -- sometimes it can look quite bad compared to the (proper) linear computation... As far as I can tell, none of the Go standard library does linear blending; and all of the image formats are assumed to be sRGB encoded. There are some 3rd party packages like [3] that can do some of color management on a 16-bit linear image format (RGBA64 == 16bits/component RGBA). The other thing the author might consider is revising the "Why?" footnote to the "Random Noise (grayscale)" section. What the author is actually doing there is just using a cheap approximation to a rounding function: round(x) ~= floor(x + 0.5). In general, doing a round like that introduces a bias [2]. That section can be summarized as: after every pixel operation, round and clamp back to the valid range. [1] https://blog.johnnovak.net/2016/09/21/what-every-coder-should-know-about-gamma/ https://blog.johnnovak.net/2016/09/21/what-every-coder-shoul... [2] http://www.cplusplus.com/articles/1UCRko23/ http://www.cplusplus.com/articles/1UCRko23/ [3] https://github.com/mandykoh/prism https://github.com/mandykoh/prism
- Macuyiko 6y agoThe matrices for clustered dot halftoning should not be too hard to generate. I think it boils down to which approach take to generate the thresholds matrix: https://dl.acm.org/doi/pdf/10.1145/127719.122727?casa_token=r7RLX2FwCCkAAAAA:accvlG1_tRYkdMpDpsxL3OoNkuFpNNNUxizbFE026c-utxJDibQxb-fnJ6Vann2UJfDVn61oKeN7eS4 https://dl.acm.org/doi/pdf/10.1145/127719.122727?casa_token=... > (ordered dither): This algorithm is generally identified as a dispersed-dot technique [Limb 69], but if the intensity threshold levels are spatially concentrated it results in a clustered-dot dithering. You want to know something cool? Here's a tech report from HP that describes a stenography approach based on halftoning: https://www.hpl.hp.com/techreports/2010/HPL-2010-136.pdf https://www.hpl.hp.com/techreports/2010/HPL-2010-136.pdf
- the8472 6y agoThere also is the void and cluster method, which gives nice results comparable to error diffusion while not suffering its data dependencies, i.e. it's as parallelizable/GPU-friendly as ordered dithering.
- skemper911 6y agoDigital Halftoning by Robert Ulichney
- antihero 6y agoDithering is also really handy if you're screen printing and want to do things in one ink cololor (IE grey to 1-bit B&W). Having Illustrator trace the dot layer is a bit painful but it seems to work!
- patrakov 6y agoAs presented, it is not really about going beyond 1 bit. It is beyond 1 color channel, with a twist that the color channels are not independent. And adaptation of dithering algorithms to a black-red-green palette (with a missing yellow) and exploration of their behavior is the scientific content that the article showcases. And the "missing yellow" constraint is important, without it, the problem would be separable and therefore uninteresting.
- shadowfaxRodeo 6y agoI built a tool for playing around with different dithering effects and palettes if anyone is interested in having a play: https://doodad.dev/dither-me-this https://doodad.dev/dither-me-this
- sllabres 6y agoJust some days ago: https://news.ycombinator.com/item?id=25633483 https://news.ycombinator.com/item?id=25633483