Ordered Dithering - Computerphile

  Рет қаралды 130,892

Computerphile

Computerphile

Күн бұрын

Пікірлер: 216
@basilg5523
@basilg5523 5 жыл бұрын
For what he's talking about, what he does for work/life/whatever, his shirt makes sense...
@matchrocket1702
@matchrocket1702 5 жыл бұрын
You beat me to it.
@omereli1062
@omereli1062 5 жыл бұрын
I have just wanted to comment that...
@mrroobarb
@mrroobarb 5 жыл бұрын
lol totally!
@jmp01a24
@jmp01a24 5 жыл бұрын
Would been nice if he put the same level of thought into his examples.
@shawnmendrek3544
@shawnmendrek3544 4 ай бұрын
lkmao
@jaredmeit6127
@jaredmeit6127 5 жыл бұрын
This channel has the most useful graphics and editing. It doesn't go unnoticed. Great work!
@technodaz
@technodaz 5 жыл бұрын
"you stop seeing the individual pixels and you just see the kind of average" It's amazing how they do that yet one single dead pixel on a monitor would not bother you until you notice it, once your brain knows it's there, it's the only thing it focuses on when watching anything.
@kpunkt.klaviermusik
@kpunkt.klaviermusik 5 жыл бұрын
When all colors are changing except that of 1 Pixel, you will see it.
@guidad542
@guidad542 5 жыл бұрын
@@kpunkt.klaviermusik Pretty much this. Basically you normalize the information and while part of it will be lost, the main attributes will still be there. Having one pixel stand out WILL annoy you
@RadioactivFly
@RadioactivFly 5 жыл бұрын
I'm very disappointed they didn't dither the video at any point.
@aleksandersuur9475
@aleksandersuur9475 4 жыл бұрын
I suspect you can't, if you try to apply lossy compression to dithered image the results are poor.
@diophantine1598
@diophantine1598 3 жыл бұрын
@@aleksandersuur9475 Just goes to show a generalised compression algorithm does not always compress other already compressed things well. Meh.
@gsittly
@gsittly 8 ай бұрын
Like in the Floyd-Steinberg video?
@scotttroyer
@scotttroyer 5 жыл бұрын
By the power of grayscale!
@lawrencedoliveiro9104
@lawrencedoliveiro9104 5 жыл бұрын
You can do it in colour, too.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 5 жыл бұрын
@@busimagen Whoosh right back atcha.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 5 жыл бұрын
@@busimagen Some people see everything in choler ...
@lawrencedoliveiro9104
@lawrencedoliveiro9104 5 жыл бұрын
@@busimagen Figured out what “whoosh” means, yet?
@lawrencedoliveiro9104
@lawrencedoliveiro9104 5 жыл бұрын
@@busimagen Yes, Fuad. That is the reason why it is funny.
@angelorf
@angelorf 5 жыл бұрын
Ordered dither doesn't necessarily create large dots; it depends on the pattern in which the checking values in the matrix are laid out.
@konstantinkh
@konstantinkh 5 жыл бұрын
Yeah. I was just about to say, there are definitely other, arguably better dithering patterns. There are also some nifty statistical, non-ordered models that can produce more organic looks, but they're just a bit more advanced.
@black_platypus
@black_platypus 5 жыл бұрын
The optical technique he describes uses AM dithering (amplitude modulated, meaning the spots were on a fixed raster, but varied in size), whereas on a screen, you're using FM (frequency modulated), where you set the points further apart or closer together to make the result look brighter or darker
@ratlinggull2223
@ratlinggull2223 5 жыл бұрын
Woah there's that thing too? FFT really links images to audio more than I thought.
@black_platypus
@black_platypus 5 жыл бұрын
Hehe, yeah Looks like we need to wait for "unordered"(?) dithering to fully appreciate the difference. In the end here, all the pixels were clumped together (who needs that? O.o)
@germansnowman
@germansnowman 5 жыл бұрын
Benjamin Philipp In fact, FM screening is also used in printing, though not as commonly as AM screening. I still remember the FM hype in the prepress/printing industry in the late 1990s. Also, I love the dithering method used for the original Mac, which was applied to both its 1-bit screen and its print output.
@fenixsyrell
@fenixsyrell 5 жыл бұрын
I love that Steve is wearing a grayscale shirt for this video. Perfect.
@RWBHere
@RWBHere 5 жыл бұрын
It's a bit like the argument about the two-coloured dress, a few years ago. In one view (e.g. 5:01), his shirt looks blue, and from the front (e.g. 5:07) it looks greyscale.
@cube2fox
@cube2fox 5 жыл бұрын
The camera which shows him from the front seems to be oversaturated, which probably makes the shirt look blue.
@cube2fox
@cube2fox 5 жыл бұрын
@Zero Cool Oh no
@ze_rubenator
@ze_rubenator 5 жыл бұрын
Have you played Return of the Obra Dinn? In my opinion it has stunning 1-bit grapics, of course with lots of dithering.
@matsv201
@matsv201 5 жыл бұрын
I'm still mad that he didn't make it 3-bit color ;)
@SteelSkin667
@SteelSkin667 5 жыл бұрын
I was about to comment about that. I learned a lot about dithering just by reading Lucas' dev log.
@ze_rubenator
@ze_rubenator 5 жыл бұрын
@@SteelSkin667 Me too. I never thought such a "basic" concept could be so difficult to work out.
@danieljensen2626
@danieljensen2626 5 жыл бұрын
I wanted to mention that as well, but couldn't remember what it was called. I remember watching a video about how he put an insane amount of work in to get the dither to look nice in 3d with the player controlling the camera angle.
@pixelflow
@pixelflow 5 жыл бұрын
The nice thing he did beyond just dithering was really smart line drawing, including inversion in the shadow areas!
@MarcRidders
@MarcRidders 5 жыл бұрын
When I was young I used characters to dither images on a daisy wheel printer, a.k.a. ASCII-art.
@mark63424able
@mark63424able 2 жыл бұрын
Dithering can be applied to depth-based shadows in 3D graphics to create semi-transparent shadows. Due to the nature of depth-based shadows, each fragment in the scene is either in shadow or not in shadow which is fine for shadows cast by opaque objects (mountains, buildings, people...) or cut-out transparent objects like foliage however things like smoke and clouds only partially block light. You can use dithering to clip fragments in the shadowcaster pass according to the opacity of the shadow-casting fragment.
@rich1051414
@rich1051414 5 жыл бұрын
In 24-bit color, grayscale can only be drawn in 8-bit, fyi :) In 32-bit color, instead of using 10-bit color, 8-bit color is still very common, with the left over byte being used as an alpha channel. During the 16-bit color days, alpha was usually done with a SINGLE bit. That is when the dithering he is talking about was put into effect. On the original unreal tournament in 16-bit color software rendering mode, all alpha was dithered 1-bit.
@pottuvoi2
@pottuvoi2 5 жыл бұрын
Also the alpha channel of framebuffer modes is really rarely used as transparent surfaces do not write into it or need it to work. Some ps2 games used it as a way to bypass some limitations as the hardware didn't have proper support for multitexturing. First rendered masking information into destination alpha and then when you rendered something on that location again you could read the previously set result and uses it's alpha for blending the new pass. (This was used for things like masking reflections on puddles on roads or building windows and such.)
@Angeljazmin12
@Angeljazmin12 5 жыл бұрын
...Summed up a whole semester of Videoinformatics into 10 minutes. This world would be a much better place if there were more teachers like Dr Bagley.
@StarryCactus
@StarryCactus 5 жыл бұрын
That's ingenious. I would never have come up with this process in a thousand years.
@ronnetgrazer362
@ronnetgrazer362 5 жыл бұрын
Nice intro! You might have started off with an episode about stippling, hatching and cross-hatching and their programmatic implementations, because these types of lithographic shading by hand preceded their photographic counterparts. From Voronoi diagrams and weighting you could segue into importance sampling and its applications. The maths to this is a lot more accessible though, so it makes sense to start where you did. I'm hoping there's a lot more to come on this subject in later episodes!
@stefanotorelli3688
@stefanotorelli3688 5 жыл бұрын
This video remember me... when I was young.... When I was fourteen I was creating a x86 Assembly program to convert Gray scale images into B/W with dithering...
@shawnmendrek3544
@shawnmendrek3544 4 ай бұрын
What a jam packed video. Thank you. No fluff or BS.
@azurevylot4958
@azurevylot4958 Жыл бұрын
You can also add Snow. In areas of whiteness, you can use what's called "black" snow. Which is black with the transparency of the random number generated for snow. Snow = 255 * RND per each pixel. In the form of grayscale. Or color layers or other uses. Like "Blur Snow" Blur on that pixel to the transparency value of the random number generated by 255 * RND
@user-vn7ce5ig1z
@user-vn7ce5ig1z 5 жыл бұрын
Dithering is one scenario in which having poor eyesight is better.
@diophantine1598
@diophantine1598 3 жыл бұрын
Or high res. I think the added special resolution makes up for the slight loss in grayscale.
@taf8903
@taf8903 2 жыл бұрын
01:24 - I've never heard the word "naive" used in this context, but I will definitely be using it more in the future.
@raykent3211
@raykent3211 5 жыл бұрын
I hope we'll get on to random and fractal methods. For the example given which has all input values midway, 128, making the binary decision based on random numbers in range rather than the table he has gives equiprobabilty for thé mid value and proportionally for others. It avoids moiré.
@Dr904
@Dr904 Жыл бұрын
Dithering is also often applied on monitors by quickly switching back and forth between two colors. For example. “8bit + FRC” is a common method to make an 8bit panel display 10bit colors on it with this type of back and forth flickering.
@cmdlp4178
@cmdlp4178 5 жыл бұрын
There are dithering-matrices with bigger size, which do not have "big dots". You need to carefully select the matrix. Computing the treshold for a k by k (k = 2ⁿ) dithering matrix with the best possible "balance": reverse_bits(interleave_bits(x, x^y), 2*n) x^y: xor of x and y interleave_bits(x, x^y): the bits of x and x^y alternating, the lowest bit is the lowest of x, the second is the lowest of x^y, the third is the second of x, and so on. reverse_bits(A, N): reverse the bits so that the lowest bit of A gets swapped with the Nth lowest bit of A...
@KuraIthys
@KuraIthys 5 жыл бұрын
Yeah, dithering is one of those tricky things. It does give you the illusion of more shades (or even new colours if you dither two colours together; say red and blue) but it comes at a cost. You're basically gaining more shades at the expense of resolution. (how much resolution loss depends on the dithering method and the nature of the image, but there's always some.) And, if you push the effect too far, the illusion of it somewhat breaks. I remember using a 5 pixel fixed dither pattern on Miiverse when that was a thing. For a completely fixed pattern (the most advanced dithering methods don't use fixed patterns) it worked really well, and gave very good results. The pattern is essentially a plus sign, with the central pixel being the first to light up, and the ones around the edge lighting up one by one. Because of the shape, this pattern interlocks in a pattern that doesn't create a horizontally aligned grid, and that makes the repetition less obvious. With 5 pixels you get 5 shades out of it if you mix two colours. (two solid colours plus 3 intermediaries.) In principle if you had say 4 base colours/shades you could do more complex things than merely mixing two shades together, but the logic behind that would probably get rather convoluted.
@blendonator
@blendonator 5 жыл бұрын
The fact he is wearing a dithered shirt is awesome 😉
@Kavukamari
@Kavukamari 5 жыл бұрын
this is awfully convenient did computerphile see me googling dithering all week long?
@KnakuanaRka
@KnakuanaRka 5 жыл бұрын
Two major questions I have about this information: 5:32 First off, these thresholds seem off. Imagine dithering a brightness of 1 with this; the 0 pixel would be on, creating a brightness of 64, when 0 would obviously be more fitting. Since you want to differentiate whether 0 or 64 would be closer, the threshold should be set at 32 instead of 0, and the other pixels should also go up by 32. Second, at 9:16, that “clumpiness” you see in higher-level threshold dithering is perfectly preventable if you redistribute the thresholds within your matrix so that they are more evenly distributed.
@indianakernick3788
@indianakernick3788 5 жыл бұрын
I initially thought that you'd have to scale the image by 0.5x and select a 2x2 pattern based on the scaled image pixels. The method described in the video is way smarter!
@azurevylot4958
@azurevylot4958 Жыл бұрын
Ok, use CONTRAST ÷ 4, or CONTRAST = 25%. This will blend your dither out. Like a small brush on a charcoal painting. Calculated shading. 😉
@CoolerQ
@CoolerQ 5 жыл бұрын
Neither of the thumbnails at the end of the video are linked anywhere.
@randall172
@randall172 5 жыл бұрын
they will be when they are released.
@j7ndominica051
@j7ndominica051 5 жыл бұрын
This and error diffusion is noise shaping towards higher frequencies. If the input color matches a palette entry, no quantization error is added, and no pattern occurs. Dithering would be addition of independent noise that is always there even for pure black/white.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 5 жыл бұрын
Technically, “dithering” is any kind of variation around a true value. Thus, addition of noise would be best described as “noise-based dithering”.
@christoffer4862
@christoffer4862 Жыл бұрын
That little square or window in which you perform your algorithm is called the Bias.
@eartheartbaratheon791
@eartheartbaratheon791 5 жыл бұрын
I can see he's all around apple fan, which seems a bit odd for a computer geek. Maybe you could make a video with him discussing why he's choosing those products over other? I've seen discussions but I think we'd all be interested in his take on it.
@ratlinggull2223
@ratlinggull2223 5 жыл бұрын
@moo you forgot the biggest thing about Windows: video games.
@tomgidden
@tomgidden 5 жыл бұрын
Apple is popular among “computer geeks”, for many of the reasons given by @moo above. macOS gives a lot of power to a developer while still providing a very usable environment for real-life tools, like email, web, calendar, office tools and so forth. Plus, a lot of the time a programmer (especially an academic) will be using remote (Unixy) servers for their actual work, so it makes no difference (to the work) what terminal they’re using. However, contrary to what @moo says, a lot of developers do use Windows. While I’m an Apple user (and can’t stand Windows) I can’t deny that Microsoft’s development tools are _excellent_. So nowadays, given a random developer, it’d be tough to guess whether they use Windows, Mac, Linux or something else. What you _can_ probably say is that they adamantly ONLY use that platform... regularly switching between different UIs, keyboard shortcuts and even keyboard _feels_ is tough.
@rufioh
@rufioh 5 жыл бұрын
So, could you simulate more colour depth on a screen by dithering the pixels on a higher resolution screen? And if you display things at high enough refresh rates, could you also simulate higher colour depth?
@iwikal
@iwikal 5 жыл бұрын
Yes. In fact, that's what many screens do. It's common for displays marketed as having 8 bits per channel to actually have 7 or even 6 bits, and use a mixture of spatial dithering like they describe in this video, and temporal, which is when you move the pattern around with each new frame to make it even less noticeable.
@Carewolf
@Carewolf 5 жыл бұрын
@@iwikal I don't any computer monitors doeing spatial dithering, but temporal dithering is quite common with many TN panels only having 6bit per colors, and then switching between how the last 2 bits are rounded make the average 8bit correct.
@RWBHere
@RWBHere 5 жыл бұрын
That's only a step away from how yellow is simulated on an RGB screen. Thanks for the superb simplified explanation.
@josephmoore4764
@josephmoore4764 5 жыл бұрын
That's even more of an optical trick because your eye only has receptors for three colors. Yellow is just what you see when Green and red cone cells are excited. The trick is to get two pixels close enough that your eye can't tell the difference in position
@johnredberg
@johnredberg 5 жыл бұрын
Hey Sean, great video as usual! Unfortunately -- well, at least w.r.t. cases like this -- KZbin has gotten rid of annotations. Meaning we can't watch the "error diffusion dithering" video by clicking that preview frame. That's a pity! I assume your publication strategy involves unlisted videos. Seems we need to have the link in the description from now on. Or alternatively, no more teasers at the end ;-)
@Computerphile
@Computerphile 5 жыл бұрын
Hi, sorry it's not finished yet or if have let you all have a preview link! >Sean
@mariajosemota1050
@mariajosemota1050 Жыл бұрын
I recommend, emulation: Queijo shader preset to RetroArch, various package. Graphic filters with CRT effects.
@valentinpedersen6144
@valentinpedersen6144 5 жыл бұрын
thank you so much! had a hard time wrapping my head around dithering, before i saw this video
@intron9
@intron9 5 жыл бұрын
please enable the auto subtitles
@JustASnack
@JustASnack 5 жыл бұрын
Very well explained! Would be cool if you followed this up with a video of dithering in audio next :)
@Friedeggonheadchan
@Friedeggonheadchan 5 жыл бұрын
Next up Floyd-Steinberg, Error diffusion and finally Blue noise
@hanflingch
@hanflingch 5 жыл бұрын
Nah, just skip the first two and go directly towards TPDF shaped blue noise dithering :D
@Carewolf
@Carewolf 5 жыл бұрын
Or they could do better ordered dithering first. The ended up with a terrible algorithm for higher dithered color resolution, no one uses that, we the bayer-matrix.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 5 жыл бұрын
4:10 No, you are filtering out the high frequencies -- that is what a low-pass filter does. This leaves only the average of the on-off mixture, which is a greyscale.
@charlibiris
@charlibiris 5 жыл бұрын
What type of dithering is his shirt? 3:45
@joshinils
@joshinils 5 жыл бұрын
I’d like to have seen the threshold example with the dithering to see what a difference it makes. Maybe with a lower resolution
@doctortroels
@doctortroels 5 жыл бұрын
8:26 That tradeoff is for halftone, not for ordered dithering in general.
@user23724
@user23724 2 жыл бұрын
Awesome video. Very clever way to work it out.
@minijimi
@minijimi 5 жыл бұрын
Right, this is going to be my Saturday morning programming project.
@SouravTechLabs
@SouravTechLabs 5 жыл бұрын
10:24, I would love Sean to add those video links to the description...
@Vaaaaadim
@Vaaaaadim 5 жыл бұрын
Why not try it in a probabilistic way? If the pixel value is x, ranging from 0-255, generate a random number r ranging from 0-255, and set the pixel white if r < x, and black if r >= x.
@Carewolf
@Carewolf 5 жыл бұрын
That is error diffusion and the next video according to the video comment.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 5 жыл бұрын
@@Carewolf No, that’s not error diffusion. Error diffusion involves keeping track of the error between the true pixel value and what you have actually displayed, and accumulating (“diffusing”) that into subsequent pixels. Hence the name.
@Carewolf
@Carewolf 5 жыл бұрын
@@lawrencedoliveiro9104What you describe sounds exactly like unordered dithering like Floyd-Stein. There is standard dithering technique that just uses random rounding and that way like ordered dithering avoids having to track the error-values around, but it might have another name. Edit: Yes, you were right, error diffusion is calculating the error and spreading it around. Random dithering is what you suggested in the first comment
@lawrencedoliveiro9104
@lawrencedoliveiro9104 5 жыл бұрын
@@Carewolf Floyd-Steinberg is one of many algorithms under the category of “error-diffusion”. It’s not the only one.
@tomasql
@tomasql 2 жыл бұрын
Superb shirt choice for this video.
@eliasnunez5218
@eliasnunez5218 5 жыл бұрын
Where does this guy get his shirts? very appropriate to the occasion.
@dreammfyre
@dreammfyre 5 жыл бұрын
The original Macintosh had some great dithering, shame he didn't draw some example from that.
@JosephDavies
@JosephDavies 5 жыл бұрын
Indeed. The patterns commonly used there are quite distinctive and I was hoping for a discussion on how they worked. Perhaps a follow-up video?
@simpletongeek
@simpletongeek 5 жыл бұрын
It's a variation of Floyd Steinberg dithering with different values, optimised for 1 bit lores mac display. Edit: Bill Atkinson dithering algorithm. Tanner Helland also has Image Dithering webpage comparing eleven algorithms.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 5 жыл бұрын
The original 32-Bit Color QuickDraw from 1988 or 1989 implemented high-quality, but slow, dithering. Then QuickTime added a faster pattern dither for playing back an approximation of full-colour movies on limited-colour displays.
@JobvanderZwan
@JobvanderZwan 5 жыл бұрын
I've been wondering for a few years now: what if we used colored dithering on Retina displays to fake a more gradual color range than the actual steps a display has available? Could we perhaps even widen the gamut?
@talelkraiem4757
@talelkraiem4757 4 жыл бұрын
thanks sir , We learned something new from you
@sieltan5618
@sieltan5618 Жыл бұрын
Is there a video on the method of converting newspaper images to black and white that he mentions?
@JossWhittle
@JossWhittle 5 жыл бұрын
4:28 that dramatic zoom.
@FlashMeterRed
@FlashMeterRed 5 жыл бұрын
Wish I could program now. Or at least follow the coding of graphical programs. Is there graphical dithering that doesn't use ordered arrays? like say: a program that compresses images by seeking out all connected pixels of random overall shape that have intensity change < x, across R, G, B or B/W (working on each independently). So dithering of random shapes can be calculated to an average across that shape, eg there's something nearly L-shaped in the red channel of.... 98 pixel size where all the R pixels have nearly the same intensity (ie. small x), which corresponds to 7 of the 98 pixels being on - it needs to calculate where across the whole L those pixels need to be turned on, taking account of the average intensity of R in all neighbouring random shapes (to avoid later edge effects - ie if the patch next door is less intense, don't put an R pixel right next to it). Perform the same thing on each RGB and B/W (contrast? brightness?) channels with whatever average shapes show up in each channel as having change in intensity < x, and averaging across those shapes, so the final image ends up with less information to store. Change x to bigger and you get a lower quality, smaller image (without effecting pixel density), smaller and you get gradually back to the original.... ... In fact could probably be stored as vector graphics... am I describing converting to vector graphics? I might be stupid.
@dielfonelletab8711
@dielfonelletab8711 5 жыл бұрын
Where was the money shot? Applying the filter to the video?
@Frosty-oj6hw
@Frosty-oj6hw 5 жыл бұрын
It's worth pointing out that this method is also commonly used in a lot of monitors to fake having a higher colour range than they really have. Typically this is used in what called TN panels, this type of panel used in a monitor will often boast 8bit colour depth but in reality they have 6bit + 2bit dithering built into the hardware. So even if your PC can output 8bit colour or more, the monitor is limited to this technique to fake the full range. This is why the "colour reproduction" in TN panels is very bad. If you want true colour which is much more accurately represented in a monitor then you need to buy monitors that are some variant of IPS, they're more expensive but can do true 8 bit and true 10bit colour which looks a lot better, and important if you're doing design work.
@dragoncurveenthusiast
@dragoncurveenthusiast 5 жыл бұрын
why not use add normally distributed random values to the pixels before rounding to black and white? then you wouldn't get such big blocks of black and white, but a more distributed pattern of white and black. I haven't thought this through completely, but my instincts tell me you could balance the spatial vs the colour resolution by varying the standard deviation of the normal distribution from which you draw the random values.
@dragoncurveenthusiast
@dragoncurveenthusiast 5 жыл бұрын
I've tried it with some code I quickly threw together in Matlab. It works! For the images I looked at, a std deviation of 10-15% of the colour range (from black to white) seems to look best, but it differs slightly for different images. This very probably exists already. I can't be the first person to think of this.
@ratlinggull2223
@ratlinggull2223 5 жыл бұрын
The heck. I was searching for resources on dithering. This is no Floyd-Steinberg, but still can't believe the massive coincidence.
@OlafDoschke
@OlafDoschke 5 жыл бұрын
You already announced error diffusion. Ideally, you'd use a hilbert curve to do that. Not sure if JPEG does that.
@TheTurnipKing
@TheTurnipKing 5 жыл бұрын
An attempt to use spacial resolution to emulate colour depth, in principle
@davidcurry5239
@davidcurry5239 5 жыл бұрын
Ordered dithering? Didn't realise you were in government.
@DrSteveBagley
@DrSteveBagley 5 жыл бұрын
Naah, its all about which pixels you leave set and which remain unset… ;)
@jhonbus
@jhonbus 5 жыл бұрын
100% perfect.
@rice-stuffedoctopus7786
@rice-stuffedoctopus7786 5 жыл бұрын
Better to use Bayer matrix. It's scalable and easy to code.
@y2ksw1
@y2ksw1 5 жыл бұрын
Yeah, years of studies and a second of genius!
@izamanaick
@izamanaick 3 жыл бұрын
brilliant video! super helpful
@ibewatchinu
@ibewatchinu 5 жыл бұрын
Wouldn't 50% be 127?
@Hagledesperado
@Hagledesperado 5 жыл бұрын
4:48 Yes. Classical off-by-one error.
@hymnsfordisco
@hymnsfordisco 5 жыл бұрын
If you consider 255 to be the maximum value of 100%, then 127 would be about 49.8%. don't think it's possible to have a perfect 50% value if also including a "zero", if storing bits
@Hagledesperado
@Hagledesperado 5 жыл бұрын
Although if you consider 0 to be the first value and 255 to be the 256th value, then 127 is the 128th value and slap bang in the middle. :)
@Carewolf
@Carewolf 5 жыл бұрын
@@Hagledesperado No, there are 128 values below 128 (0-127), but only 127 values above it (129-255)
@Hagledesperado
@Hagledesperado 5 жыл бұрын
​@@Carewolf Ok, fair point. So the mid point is between 127 and 128. And I guess that's why a signed byte goes from -128 to 127. Zero ruins everything.
@AlexiiNoir
@AlexiiNoir 5 жыл бұрын
What algorithm do you use for halftone dithering at 8:59?
@starrmayhem
@starrmayhem 5 жыл бұрын
what if you cheese the system 064 128 | 065 129 192 000 | 193 001 then you just get a white image, any way to fix this
@jamesyeoman794
@jamesyeoman794 5 жыл бұрын
So, are there any practical applications outside of grayscale? For example, would applying dithering to the different colour channels to get dithered RGB be practical at all?
@Gummibrandur
@Gummibrandur 5 жыл бұрын
Yes, this works on rgb images, the practical application is that you now need less bits to store the image, this is useful in image compression
@lawrencedoliveiro9104
@lawrencedoliveiro9104 5 жыл бұрын
@@Gummibrandur It’s a lousy way to do image compression, though.
@shawn2736
@shawn2736 5 жыл бұрын
In printing, you have to dither your image in the 4-color process to produce 4 different print images. Scaling up the filters is useful for "halftone" design elements.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 5 жыл бұрын
@@shawn2736 That’s not “dithering”. That’s “screening”.
@notfound-bk5wn
@notfound-bk5wn 3 жыл бұрын
Thank u you just save my midterm exam😭
@circuitdotlt
@circuitdotlt 5 жыл бұрын
This needs a followup.
@JNCressey
@JNCressey 5 жыл бұрын
But does it work for more colours? 😁
@Whelkman
@Whelkman 5 жыл бұрын
Yes. For example, GIF has, for most intents and purposes, a 256-color limitation. Therefore many images and practically every animation will use some sort of dithering. Sometimes it'll be error diffusion and other times it'll be ordered dithering as seen here. Ordered dithering was also popular with the Sega Mega Drive. On a low resolution CRT the "dots" would blend into colors the system couldn't ordinarily show or even produce pseudo-transparency effects the console didn't support.
@JNCressey
@JNCressey 5 жыл бұрын
@@Whelkman, (It was a joke because of how many times he said 'it works for more colours but let's just look at black and white' in the first few minutes.)
@the_niss
@the_niss 5 жыл бұрын
Perfect shirt for this topic
@yuechenzhao2346
@yuechenzhao2346 Жыл бұрын
thanks, this is great explanation!
@mrmimeisfunny
@mrmimeisfunny 5 жыл бұрын
Are you going to do Floyd-Steinsberg next?
@lawrencedoliveiro9104
@lawrencedoliveiro9104 5 жыл бұрын
That’s one of many different error-diffusion algorithms.
@dipi71
@dipi71 5 жыл бұрын
Floyd-Steinberg, yes please. Takes me right back to some lovely ST-high and monochrome Mac pixel art.
@frankharr9466
@frankharr9466 5 жыл бұрын
I can see how the concept of LPI would map to this.
@TheGREATdEEPs
@TheGREATdEEPs 6 ай бұрын
Thanks ❤
@harrkev
@harrkev 5 жыл бұрын
Why not mention of the method of adding random noise before quantization? That method works MUCH better than anything that you did.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 5 жыл бұрын
No it wouldn’t. Or, to be more precise, it might work in other situations (e.g. audio), but not here.
@SMWssaamm
@SMWssaamm 5 жыл бұрын
wondering how this translates to multi-color dithering
@punstress
@punstress 3 жыл бұрын
Ah, now I get it. I just have to figure out how to code it now.
@BradCozine
@BradCozine 5 жыл бұрын
7:38 Isn't that a quote from Mel Brook's "History of the World, Part 1"? LOL
@marty34534
@marty34534 3 жыл бұрын
Awesome video! Thank-you so much :)
@amphetaminehamster
@amphetaminehamster 5 жыл бұрын
Oh god those squares are trippy
@bepstein111
@bepstein111 5 жыл бұрын
Okay but where does the grid of 64,128,192,0 come from? Am I missing something?
@tenseikenzx-3559
@tenseikenzx-3559 5 жыл бұрын
Dr Bagley's shirt is relevant to this video
@DrSteveBagley
@DrSteveBagley 5 жыл бұрын
'I always dress for the occasion…'
@MaverickJeyKidding
@MaverickJeyKidding 5 жыл бұрын
I wonder how many times this guy's shirt got dithered
@sandwich2473
@sandwich2473 5 жыл бұрын
I remember comics would use the same technique for colours.
@leifmessinger
@leifmessinger 5 жыл бұрын
Why aren’t laser engravers grayscale?
@IntrinsicPalomides
@IntrinsicPalomides 5 жыл бұрын
Looks like a BBC Micro in the background there! we actually have one at work for people to play with :)
@feldinho
@feldinho 5 жыл бұрын
shirt checks out
@Bildungsromancuddy
@Bildungsromancuddy 5 жыл бұрын
Dr. Bagley’s shirt 👔 is dithered!
@raglanheuser1162
@raglanheuser1162 5 жыл бұрын
after this video i feel its time to return to the obra dinnn
@ge7862
@ge7862 5 жыл бұрын
I really hope that shirt choice was deliberate.
@Tridd666
@Tridd666 5 жыл бұрын
George Costanza had a kid?
@philosoaper
@philosoaper 5 жыл бұрын
hmm.. should I point out that CRT era monitors didn't have pixels?
@albertbatfinder5240
@albertbatfinder5240 5 жыл бұрын
The cathode ray might perform analogue sweeps but it fires through a shadow mask onto phosphors. Electronics imposes an integral number of horizontal scan lines. Even a purely analogue combination such as film and optical lenses will have a resolution based on the grain size of the chemical emulsion.
@philosoaper
@philosoaper 5 жыл бұрын
@@albertbatfinder5240 so they're not pixels..its not whether the crt does an analog sweep or not.. a pixel changes it's color individually..
@albertbatfinder5240
@albertbatfinder5240 5 жыл бұрын
Pixels as an addressable unit were around on CRT screens. I distinctly remember programming the IBM AT with its crisp 720x350 pixel screen driven through a Hercules graphics card. The monitor was definitely CRT, any colour you want, so long as it was green.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 5 жыл бұрын
But the digital graphics adapters driving them certainly did. And still do.
@philosoaper
@philosoaper 5 жыл бұрын
@@albertbatfinder5240 the graphics adapter sure.. of course, but the a CRT does not have pixels.
@laharl2k
@laharl2k 5 жыл бұрын
50 levels of grey, an IT love novel
@Kotfluegel
@Kotfluegel 5 жыл бұрын
I would have naively generated a random number for each pixel and only switched it to white, if the generated number is larger than the greyscale value.
@eturnerx
@eturnerx 5 жыл бұрын
"Ordered Dithering" at first I thought this video was about a career in academia.
Error Diffusion Dithering - Computerphile
6:16
Computerphile
Рет қаралды 79 М.
Self Compiling Compilers - Computerphile
12:56
Computerphile
Рет қаралды 160 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
How Secure Shell Works (SSH) - Computerphile
9:20
Computerphile
Рет қаралды 825 М.
Coding Challenge #90: Floyd-Steinberg Dithering
28:51
The Coding Train
Рет қаралды 440 М.
GUI: Under the Hood - Computerphile
17:26
Computerphile
Рет қаралды 154 М.
Multithreading Code - Computerphile
15:54
Computerphile
Рет қаралды 389 М.
Has Generative AI Already Peaked? - Computerphile
12:48
Computerphile
Рет қаралды 1 МЛН
Multi Programming - Computerphile
12:30
Computerphile
Рет қаралды 80 М.
XZ Exploit - Computerphile
14:41
Computerphile
Рет қаралды 47 М.
GUI Programming Introduction - Computerphile
10:32
Computerphile
Рет қаралды 206 М.
A brief discussion of Dithering
10:25
theosib
Рет қаралды 7 М.
Creating Your Own Programming Language - Computerphile
21:15
Computerphile
Рет қаралды 192 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН