Error Diffusion Dithering - Computerphile

  Рет қаралды 78,167

Computerphile

Computerphile

5 жыл бұрын

The smarter way to dither. Dr Bagley takes us through the Floyd-Steinberg error diffusion dithering technique.
/ computerphile
/ computer_phile
This video was filmed and edited by Sean Riley.
Computer Science at the University of Nottingham: bit.ly/nottscomputer
Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com

Пікірлер: 103
@pseudo_goose
@pseudo_goose 5 жыл бұрын
Aw man, you had to put in a teaser for audio dithering at the end. I hope that's in a video soon!
@azyfloof
@azyfloof 5 жыл бұрын
It was probably in the audio of _this_ video :P
@ChristopherMeadors
@ChristopherMeadors 5 жыл бұрын
I'm definitely here for the audio dithering. There's an excellent Xiph video called Digital Show and Tell, that goes into what dither does for audio. But other than providing a sample code download, it doesn't really go into the how it's implemented.
@kaitlyn__L
@kaitlyn__L 5 жыл бұрын
Me too!
@sixft7in
@sixft7in 5 жыл бұрын
I love how Dr. Bagley wears that shirt for the dithering videos.
@totlyepic
@totlyepic 5 жыл бұрын
...I think it's more likely that the two videos were just recorded on the same day.
@sixft7in
@sixft7in 5 жыл бұрын
@@totlyepic True, but the fact that he wore that shirt for both or each is still funny.
@sixft7in
@sixft7in 5 жыл бұрын
@Zero Cool Oh, I know. Either way it's funny to me, accidental or intentional.
@TimTam69420
@TimTam69420 5 жыл бұрын
I very much hope you asked how they do it for audio. its actually pretty straightforward and would make for an interesting video
@veggiet2009
@veggiet2009 5 жыл бұрын
It's interesting that I've seen these different styles of dithering, and I've recognized them as different, but I've never considered what made them different.... These videos are fascinating. I'd like more detail about how the algorithms translate to color and to higher bit depths.
@jursamaj
@jursamaj 3 жыл бұрын
In color, you'd simply dither each of the color channels (red, green, & blue) separately. For higher bits depths, you just pick values for each pixel value. So instead of black (0) and white (255) for 1-bit, you'd have 0, 85, 170, & 255 for 2-bit. You'd use the same error diffusion after picking the nearest value. Technically, your values don't have to be equally spaced, and the formulae really should account for things like display gamma.
@DreadKyller
@DreadKyller 5 жыл бұрын
even with how many colors we have today on most modern devices dithering is still used even with 8-bit colors, if you have a smooth gradient there are points where it moves from being solid 80 for example down to solid 79, and while that's not really noticeable, you can still dither that change to blend the colors together to simulate even more colors in between. Because when zoomed in even 256 options per color channel can still have banding issues, dithering as it zooms in helps remove such banding artifacts.
@user-zz6fk8bc8u
@user-zz6fk8bc8u 5 жыл бұрын
Dithering is still used in generated color images to reduce banding.
@silkwesir1444
@silkwesir1444 5 жыл бұрын
What a great idea, why didn't I think of that. Thanks.
@lazycrypt6893
@lazycrypt6893 5 жыл бұрын
KZbin compression sure didn't like the dithering.
@jerrywatson1958
@jerrywatson1958 5 жыл бұрын
Wow you earned a new sub today! Finally after all these years of seeing this kind of dithering in my (then) Amiga photo creation software and graphics it clicked! How the computer calculates each pixel on the screen. The math is calculated and displayed SO fast it puts me in awe of what designers have done. This helps me in what I am trying to learn to do in Blender and understand lighting.
@tungstikum
@tungstikum 5 жыл бұрын
"Error diffusion dithering" is how I walk home from the pub.
@haulin
@haulin 5 жыл бұрын
It's also my relationship strategy. I don't return to the one I've already done.
@JaccovanSchaik
@JaccovanSchaik 5 жыл бұрын
Wonder what dithering algorithm the shirt uses.
@haulin
@haulin 5 жыл бұрын
Must be a crappy one. I can't work out what was the original image.
@FyberOptic
@FyberOptic 5 жыл бұрын
These videos were so interesting that after the last one I started playing with implementing a color dithering script, just to experiment with it. Dithering is always something I took for granted in programs like Paint Shop Pro over the last few decades, but never really considered how it worked.
@mrsvcd
@mrsvcd 5 жыл бұрын
Thank you for explaining Floyd-Steinberg dithering and now I can understand the notation for it as well.
@mspysu79
@mspysu79 5 жыл бұрын
Another good video, and a teaser for what Sony used to call "Super BitMapping" using a 20 bit ADC and dithering down to 16 bit for recording on a CD.
@roderik1990
@roderik1990 5 жыл бұрын
Notes that you likely want to add some noise before going through the whole floyd-steinberg process. (of the proper PDF) To prevent noise modulation from being too noticeable. Error diffusion dithering like Floyd-Steinberg, is analogous to noise shaping in audio dithering.
@10100rsn
@10100rsn 5 жыл бұрын
What about half-tone algorithms where there is lpi and angle?
@piteoswaldo
@piteoswaldo 5 жыл бұрын
What's the name of the dither technique that simply sums a white noise to the original image before thresholding?
@user-vn7ce5ig1z
@user-vn7ce5ig1z 5 жыл бұрын
5:00 - That's how PWM works.
@stanrogers5613
@stanrogers5613 5 жыл бұрын
...or PCM (pulse code modulation), where the on/off edges are fixed, which can make some parts of the circuitry easier to manage, but the pattern of pulses is varied (basically a single-bit synchronous encoding of a number). That was how single-bit oversampling worked on many of the early "hifi" CD players, for instance, to move the quantization noise far enough out of the audio frequency range to make filtering easy using lower-order filters (which don't hurt teeth nearly as badly as "brick wall" high-order filter phase shifts).
@KX36
@KX36 5 жыл бұрын
or PFM
@NullPointer
@NullPointer 5 жыл бұрын
It's also used today in Deferred Rendered engines to acchieve screen door transparency
@misterhat5823
@misterhat5823 5 жыл бұрын
Dithering down (or reducing bit width) is a different process. A random noise (or triangle wave to cheat) is added to the signal and then it's truncated. This is done instead of rounding or simple truncation.
@matt4193
@matt4193 5 жыл бұрын
Nice dithered shirt, Dr. Bagley.
@Rocket_Try
@Rocket_Try 3 жыл бұрын
Great, thank you so much. Got it working with your explanation on an ESP32 Cam.
@NoHandleToSpeakOf
@NoHandleToSpeakOf 5 жыл бұрын
Animated GIF is limited to 256 colors and they use dithering too.
@superscatboy
@superscatboy 5 жыл бұрын
If keeping the size of a gif to a minimum is a major concern, dithering is your worst enemy :P
@NoHandleToSpeakOf
@NoHandleToSpeakOf 5 жыл бұрын
@@superscatboy True. Multi-meg gifs are rarely problematic these days though
@pattywu9301
@pattywu9301 2 ай бұрын
Thanks for the video really helpful
@alexxxcanz
@alexxxcanz 5 жыл бұрын
I’d like a video on Intel Management Engine. About what is it, how does it work and how to disabled it. That would be great!
@Sth0r
@Sth0r 5 жыл бұрын
Hey love the stuff you guys and girls make on this channel. what happnes if you do this to the red, the green and the blue layers and rekomebine them?
@decece
@decece 5 жыл бұрын
There's a nice example at: caca.zoy.org/study/part6.html
@arsnakehert
@arsnakehert 4 жыл бұрын
_Excellent_ choice of shirt
@f4614n
@f4614n 5 жыл бұрын
At 4:01 it really shows that video compression was not designed to cope with dithered signals.
@misterhat5823
@misterhat5823 5 жыл бұрын
Very true. It's adding high frequency noise and most compression methods attempt to throw out high frequency signals.
@nsputnik
@nsputnik 5 жыл бұрын
How did you create the dithering example at 4:04? I have been wanting to do this in VDMX. I can do it with still images by bringing a .jpg into Classic Mac OS Photoshop and switching to graysacale and then halftone.
@TheAnarchoX_
@TheAnarchoX_ 2 жыл бұрын
We use it to dither lens molds, these lens printer heads have a resolution of a few microns and are rather fault sensitive by applying dithering to the 3d mapping we can eliminate the error of broken printer heads so that we always get a smooth result
@roar779
@roar779 5 жыл бұрын
Can someone please tell me what the last sentence was after the big pause? at 5:52
@forthrightgambitia1032
@forthrightgambitia1032 5 жыл бұрын
A video on line/circle drawing algorithms would be nice.
@benjamimapancake6429
@benjamimapancake6429 5 жыл бұрын
Seconded or rather, seventhed
@renemunkthalund3581
@renemunkthalund3581 5 жыл бұрын
I would like to have seen dithering in time exemplified on Dr. Bagley. I know it would take some coding, since it's not readily available like Floyd-Steinberg.
@themusicicreate
@themusicicreate 5 жыл бұрын
I'd love to learn about audio dithering like he alluded to at the end!
@juschu85
@juschu85 5 жыл бұрын
The export dialog in my music software also gives me a dithering option. So this is probably also dithering over time since you can only hear a single sample at a time. So in that case, the error is just carried over to the next sample, right?
@groszak1
@groszak1 5 жыл бұрын
nope, that leads to high frequencies, in audio dithering they randomize whether to round up or down so that the error is uniformly a noise
@WacKEDmaN
@WacKEDmaN 5 жыл бұрын
i wanna know about audio dithering!
@karlkastor
@karlkastor 5 жыл бұрын
Isn't 'dithering in time' just Pulse-width modulation?
@misterhat5823
@misterhat5823 5 жыл бұрын
Never thought of that, but essentially yes.
@danieljensen2626
@danieljensen2626 5 жыл бұрын
Sounds like it yeah, but for each pixel in an image.
@n00dle_king
@n00dle_king 5 жыл бұрын
Such a cool algorithm. Makes me miss school.
@solemnwaltz
@solemnwaltz 5 жыл бұрын
Nice! Your shirt matches your topic. :D
@noestreet760
@noestreet760 4 жыл бұрын
If these values are based on quadrants, why is the maximum 255, not 256?
@raydleemsc
@raydleemsc 5 жыл бұрын
So is Floyd-Steinberg used in audio dithering?
@misterhat5823
@misterhat5823 5 жыл бұрын
No.
@groszak1
@groszak1 5 жыл бұрын
humans perceive audio differently than images so Floyd-Steinberg isn't the best choice for audio dithering, randomizing whether to round up or down gives better results for audio
@OrangeC7
@OrangeC7 5 жыл бұрын
Me in the previous video: Awww what they didn't show off the dithering on that image! Me in this video: Oh, that's why they didn't show it off
@BlankBrain
@BlankBrain 5 жыл бұрын
5:52 Please discuss dithering in audio.
@JamesBrown-oz5bl
@JamesBrown-oz5bl 5 жыл бұрын
of course you'd first multiply and only then divide and you'd want gamma correction in your error values...
@3dlabs99
@3dlabs99 5 жыл бұрын
That shirt is perfect for the video :)
@dreammfyre
@dreammfyre 5 жыл бұрын
Double surnames always makes me think of some dystopian mega-corporation. Maas-Chen Holdings etc.
@simonmultiverse6349
@simonmultiverse6349 2 жыл бұрын
Was your shirt created by a dithering algorithm?
@victorx4648
@victorx4648 5 жыл бұрын
A funny thing - just yesterday I was wondering how those dithering algorithms are working. :)
@AlphaFoxDelta
@AlphaFoxDelta 5 жыл бұрын
Always a pleasure, even if this isnt not my error of expertise, heh
@sogerc1
@sogerc1 5 жыл бұрын
I remember so-so many years ago, when color was a problem for videocards I used to love dithering. Except when looking at pictures of naked chicks ;-)
@TheRumpletiltskin
@TheRumpletiltskin 5 жыл бұрын
PLS DO AUDIO DITHERING!
@NVRMTmotion
@NVRMTmotion 5 жыл бұрын
Just wrote a python program for cropping and printing photos on thermal printers, dithering required, still relevant and fascinating!
@someone-br9ur
@someone-br9ur 5 жыл бұрын
notch's tweet
@KOrbyPoulpe
@KOrbyPoulpe 5 жыл бұрын
Recently, Dithering have also been heavily used in the game "Return of the Obra Dinn" released in october 2018
@cacheman
@cacheman 5 жыл бұрын
Lucas Pope (the author) did some additional work to make the dithering more stable under movment. He wrote about the technical details in a post on tigsource, which can be easily found through google by searching for something like "lucas pope dithering" #bayermatrix #bluenoise
@rev_lunar
@rev_lunar 5 жыл бұрын
Dithering in time seems like it would be the best solution for static images as it wouldn't compromise image quality, but would require more resources.
@misterhat5823
@misterhat5823 5 жыл бұрын
There's a limited frame rate most display devices can use, so the benefits are less than you might expect.
@KuraIthys
@KuraIthys 5 жыл бұрын
Floyd-Steinberg is a better method on paper, but personally I've always found it to be one of the uglier methods to perform dithering. Guess there's always compromises with stuff like this...
@hillwin10
@hillwin10 5 жыл бұрын
Oh -- we are getting "fancy." Lol.
@cipherxen2
@cipherxen2 3 жыл бұрын
His shirt can be dithered
@danfg7215
@danfg7215 5 жыл бұрын
black then white then black then white then black then white then black then white then black then white then black then white then black then white then black then white then black then white then...
@preferredimage
@preferredimage 5 жыл бұрын
Cool minecraft shirt bro! ;)
@michaelcharlesthearchangel
@michaelcharlesthearchangel 5 жыл бұрын
Hm. The moment a voxel-deep hologram shade appears and then fills in. I see some kind of holodithering occurring until less than 2 percent error is maintained. Quantum computers/hyperservers will help us speed up the resolution-- error correction of a quantumFlashplayer playing a holovideo.
@hrnekbezucha
@hrnekbezucha 5 жыл бұрын
Printers are black and white. A colour printer is four printers in one package, each doing one colour.
@vitalnutrients744
@vitalnutrients744 5 жыл бұрын
130th!
@Eternal_23
@Eternal_23 5 жыл бұрын
Blue noise is answer for everything
@blazbole3342
@blazbole3342 7 ай бұрын
nice teeth
@blazbole3342
@blazbole3342 7 ай бұрын
space for train
@blazbole3342
@blazbole3342 7 ай бұрын
sry bro. ly
@fredericchopin2947
@fredericchopin2947 5 жыл бұрын
Philip Seymour Hoffman
@schatjepatatje767
@schatjepatatje767 5 жыл бұрын
uwu
@Muzkaw
@Muzkaw 5 жыл бұрын
It's pixel level ASCII art!
@SeamusCampbell89
@SeamusCampbell89 5 жыл бұрын
First
@misterhat5823
@misterhat5823 5 жыл бұрын
First down vote.
@superscatboy
@superscatboy 5 жыл бұрын
This is extremely interesting.
@VIVAFPV
@VIVAFPV 5 жыл бұрын
boring
Ordered Dithering - Computerphile
10:35
Computerphile
Рет қаралды 128 М.
Multithreading Code - Computerphile
15:54
Computerphile
Рет қаралды 380 М.
🤔Какой Орган самый длинный ? #shorts
00:42
Does size matter? BEACH EDITION
00:32
Mini Katana
Рет қаралды 19 МЛН
Bootstrapping with T-Diagrams - Computerphile
15:49
Computerphile
Рет қаралды 165 М.
What is Big Data? - Computerphile
11:53
Computerphile
Рет қаралды 211 М.
Sleeping Beauty Paradox - Numberphile
15:45
Numberphile
Рет қаралды 315 М.
Separable Filters and a Bauble - Computerphile
10:41
Computerphile
Рет қаралды 103 М.
GUI: Under the Hood - Computerphile
17:26
Computerphile
Рет қаралды 153 М.
Why did the PlayStation 1 have so much Dithering? | MVG
11:05
Modern Vintage Gamer
Рет қаралды 270 М.
Self Compiling Compilers - Computerphile
12:56
Computerphile
Рет қаралды 158 М.
The Lightning Algorithm - Numberphile
12:24
Numberphile
Рет қаралды 541 М.
How Your Computer Draws Lines
4:26
Andre Prihodko
Рет қаралды 174 М.
What is a Number? - Numberphile
11:21
Numberphile
Рет қаралды 372 М.
🤔Какой Орган самый длинный ? #shorts
00:42