Ordered Dithering - Computerphile

Поділитися
Вставка
  • Опубліковано 27 бер 2019
  • How do we represent multiple greys with simple black or white pixels? Dr Bagley joins the dots!
    Error Diffusion Dithering: COMING SOON
    How JPEG Works: • How JPEG Works
    / 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
  • Авто та транспорт

КОМЕНТАРІ • 214

  • @basilg5523
    @basilg5523 5 років тому +282

    For what he's talking about, what he does for work/life/whatever, his shirt makes sense...

    • @matchrocket1702
      @matchrocket1702 5 років тому +4

      You beat me to it.

    • @omereli1062
      @omereli1062 5 років тому +4

      I have just wanted to comment that...

    • @mrroobarb
      @mrroobarb 5 років тому +2

      lol totally!

    • @jmp01a24
      @jmp01a24 5 років тому +1

      Would been nice if he put the same level of thought into his examples.

  • @jaredmeit6127
    @jaredmeit6127 5 років тому +156

    This channel has the most useful graphics and editing. It doesn't go unnoticed. Great work!

  • @RadioactivFly
    @RadioactivFly 5 років тому +115

    I'm very disappointed they didn't dither the video at any point.

    • @aleksandersuur9475
      @aleksandersuur9475 4 роки тому +5

      I suspect you can't, if you try to apply lossy compression to dithered image the results are poor.

    • @diophantine1598
      @diophantine1598 3 роки тому +1

      @@aleksandersuur9475 Just goes to show a generalised compression algorithm does not always compress other already compressed things well. Meh.

    • @gsittly
      @gsittly 2 місяці тому

      Like in the Floyd-Steinberg video?

  • @technodaz
    @technodaz 5 років тому +43

    "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 років тому +6

      When all colors are changing except that of 1 Pixel, you will see it.

    • @guidad542
      @guidad542 5 років тому +3

      @@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

  • @angelorf
    @angelorf 5 років тому +34

    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 років тому +4

      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.

  • @scotttroyer
    @scotttroyer 5 років тому +84

    By the power of grayscale!

  • @MarcRidders
    @MarcRidders 5 років тому +19

    When I was young I used characters to dither images on a daisy wheel printer, a.k.a. ASCII-art.

  • @ze_rubenator
    @ze_rubenator 5 років тому +128

    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 років тому +5

      I'm still mad that he didn't make it 3-bit color ;)

    • @SteelSkin667
      @SteelSkin667 5 років тому +7

      I was about to comment about that. I learned a lot about dithering just by reading Lucas' dev log.

    • @ze_rubenator
      @ze_rubenator 5 років тому +5

      @@SteelSkin667 Me too. I never thought such a "basic" concept could be so difficult to work out.

    • @danieljensen2626
      @danieljensen2626 5 років тому +7

      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 років тому +3

      The nice thing he did beyond just dithering was really smart line drawing, including inversion in the shadow areas!

  • @black_platypus
    @black_platypus 5 років тому +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.

  • @rich1051414
    @rich1051414 5 років тому +10

    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 років тому +1

      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.)

  • @fenixsyrell
    @fenixsyrell 5 років тому +27

    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

  • @mark63424able
    @mark63424able Рік тому +1

    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.

  • @user-vn7ce5ig1z
    @user-vn7ce5ig1z 5 років тому +23

    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.

  • @ronnetgrazer362
    @ronnetgrazer362 5 років тому +4

    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!

  • @JacobSmith_emjds
    @JacobSmith_emjds 5 років тому +1

    That's ingenious. I would never have come up with this process in a thousand years.

  • @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.

  • @azurevylot4958
    @azurevylot4958 10 місяців тому

    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

  • @christoffer4862
    @christoffer4862 6 місяців тому +1

    That little square or window in which you perform your algorithm is called the Bias.

  • @CoolerQ
    @CoolerQ 5 років тому +31

    Neither of the thumbnails at the end of the video are linked anywhere.

    • @randall172
      @randall172 5 років тому +1

      they will be when they are released.

  • @valentinpedersen6144
    @valentinpedersen6144 5 років тому +1

    thank you so much! had a hard time wrapping my head around dithering, before i saw this video

  • @Dr904
    @Dr904 11 місяців тому

    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.

  • @intron9
    @intron9 5 років тому +2

    please enable the auto subtitles

  • @Kavukamari
    @Kavukamari 5 років тому +1

    this is awfully convenient
    did computerphile see me googling dithering all week long?

  • @raykent3211
    @raykent3211 5 років тому +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é.

  • @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.

  • @stefanotorelli3688
    @stefanotorelli3688 5 років тому +2

    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...

  • @User36282
    @User36282 2 роки тому

    Awesome video. Very clever way to work it out.

  • @blendonator
    @blendonator 5 років тому +6

    The fact he is wearing a dithered shirt is awesome 😉

  • @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.

  • @indianakernick3788
    @indianakernick3788 5 років тому +1

    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!

  • @mariajosemota1050
    @mariajosemota1050 7 місяців тому +1

    I recommend, emulation: Queijo shader preset to RetroArch, various package. Graphic filters
    with CRT effects.

  • @eartheartbaratheon791
    @eartheartbaratheon791 5 років тому +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 років тому +1

      @moo you forgot the biggest thing about Windows: video games.

    • @tomgidden
      @tomgidden 5 років тому +1

      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.

  • @JustASnack
    @JustASnack 5 років тому +1

    Very well explained! Would be cool if you followed this up with a video of dithering in audio next :)

  • @johnredberg
    @johnredberg 5 років тому +2

    Hey Sean, great video as usual! Unfortunately -- well, at least w.r.t. cases like this -- UA-cam 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 років тому +2

      Hi, sorry it's not finished yet or if have let you all have a preview link! >Sean

  • @talelkraiem4757
    @talelkraiem4757 4 роки тому

    thanks sir , We learned something new from you

  • @izamanaick
    @izamanaick 3 роки тому

    brilliant video!
    super helpful

  • @tomasql
    @tomasql Рік тому

    Superb shirt choice for this video.

  • @yuechenzhao2346
    @yuechenzhao2346 10 місяців тому

    thanks, this is great explanation!

  • @rufioh
    @rufioh 5 років тому +6

    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 років тому +4

      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.

  • @marty34534
    @marty34534 3 роки тому

    Awesome video! Thank-you so much :)

  • @azurevylot4958
    @azurevylot4958 10 місяців тому +1

    Ok, use CONTRAST ÷ 4, or CONTRAST = 25%.
    This will blend your dither out. Like a small brush on a charcoal painting. Calculated shading. 😉

  • @SouravTechLabs
    @SouravTechLabs 5 років тому

    10:24, I would love Sean to add those video links to the description...

  • @charlibiris
    @charlibiris 5 років тому +3

    What type of dithering is his shirt? 3:45

  • @minijimi
    @minijimi 5 років тому

    Right, this is going to be my Saturday morning programming project.

  • @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.

  • @AlexiiNoir
    @AlexiiNoir 5 років тому

    What algorithm do you use for halftone dithering at 8:59?

  • @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”.

  • @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?

  • @Friedeggonheadchan
    @Friedeggonheadchan 5 років тому +6

    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.

  • @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

  • @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

  • @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.

  • @eliasnunez5218
    @eliasnunez5218 5 років тому

    Where does this guy get his shirts? very appropriate to the occasion.

  • @OlafDoschke
    @OlafDoschke 5 років тому

    You already announced error diffusion. Ideally, you'd use a hilbert curve to do that. Not sure if JPEG does that.

  • @dreammfyre
    @dreammfyre 5 років тому +5

    The original Macintosh had some great dithering, shame he didn't draw some example from that.

    • @JosephDavies
      @JosephDavies 5 років тому +1

      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 років тому +1

      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.

  • @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.

  • @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.

  • @doctortroels
    @doctortroels 5 років тому

    8:26 That tradeoff is for halftone, not for ordered dithering in general.

  • @amirrezaghafoori7593
    @amirrezaghafoori7593 4 роки тому

    great explanation
    thank U

  • @bepstein111
    @bepstein111 5 років тому

    Okay but where does the grid of 64,128,192,0 come from? Am I missing something?

  • @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.

  • @TheTurnipKing
    @TheTurnipKing 5 років тому

    An attempt to use spacial resolution to emulate colour depth, in principle

  • @shadynasty6393
    @shadynasty6393 7 місяців тому

    Amazing ty

  • @dielfonelletab8711
    @dielfonelletab8711 5 років тому

    Where was the money shot? Applying the filter to the video?

  • @rice-stuffedoctopus7786
    @rice-stuffedoctopus7786 5 років тому +1

    Better to use Bayer matrix. It's scalable and easy to code.

  • @davidcurry5239
    @davidcurry5239 5 років тому +26

    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.

  • @circuitdotlt
    @circuitdotlt 5 років тому +1

    This needs a followup.

  • @FlashMeterRed
    @FlashMeterRed 4 роки тому

    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.

  • @Nilguiri
    @Nilguiri 5 років тому

    Interesting. Thanks.

  • @BradCozine
    @BradCozine 5 років тому

    7:38 Isn't that a quote from Mel Brook's "History of the World, Part 1"? LOL

  • @IntrinsicPalomides
    @IntrinsicPalomides 5 років тому

    Looks like a BBC Micro in the background there! we actually have one at work for people to play with :)

  • @TheGREATdEEPs
    @TheGREATdEEPs 29 днів тому

    Thanks ❤

  • @koutsrem5458
    @koutsrem5458 5 років тому +1

    Nice

  • @amphetaminehamster
    @amphetaminehamster 5 років тому

    Oh god those squares are trippy

  • @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 років тому +1

      @@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 років тому +1

      @@Carewolf Floyd-Steinberg is one of many algorithms under the category of “error-diffusion”. It’s not the only one.

  • @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”.

  • @feldinho
    @feldinho 5 років тому

    shirt checks out

  • @SMWssaamm
    @SMWssaamm 5 років тому

    wondering how this translates to multi-color dithering

  • @notfound-bk5wn
    @notfound-bk5wn 2 роки тому

    Thank u you just save my midterm exam😭

  • @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

  • @y2ksw1
    @y2ksw1 5 років тому +1

    Yeah, years of studies and a second of genius!

  • @sandwich2473
    @sandwich2473 5 років тому +1

    I remember comics would use the same technique for colours.

  • @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.

  • @leifmessinger
    @leifmessinger 5 років тому

    Why aren’t laser engravers grayscale?

  • @punstress
    @punstress 2 роки тому

    Ah, now I get it. I just have to figure out how to code it now.

  • @mrmimeisfunny
    @mrmimeisfunny 5 років тому +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.

  • @nihonam
    @nihonam 5 років тому

    now I see checkerboard ghost )))
    and will he speak on different dithering algorithms?

  • @raglanheuser1162
    @raglanheuser1162 4 роки тому

    after this video i feel its time to return to the obra dinnn

  • @tenseikenzx-3559
    @tenseikenzx-3559 5 років тому

    Dr Bagley's shirt is relevant to this video

    • @DrSteveBagley
      @DrSteveBagley 5 років тому +1

      'I always dress for the occasion…'

  • @davef21370
    @davef21370 5 років тому +2

    Wouldn't 50% be 127?

    • @Hagledesperado
      @Hagledesperado 5 років тому +1

      4:48 Yes. Classical off-by-one error.

    • @hymnsfordisco
      @hymnsfordisco 5 років тому +1

      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 років тому +1

      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 років тому +2

      @@Hagledesperado No, there are 128 values below 128 (0-127), but only 127 values above it (129-255)

    • @Hagledesperado
      @Hagledesperado 5 років тому +1

      ​@@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.

  • @MaverickJeyKidding
    @MaverickJeyKidding 5 років тому

    I wonder how many times this guy's shirt got dithered

  • @Lesterandsons
    @Lesterandsons 3 роки тому

    👍

  • @BrekMartin
    @BrekMartin 5 років тому

    That sux. I prefer to change to duty cycle of each pixel by cycling a number of bitplanes.

  • @JNCressey
    @JNCressey 5 років тому +2

    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.)

  • @ge7862
    @ge7862 5 років тому

    I really hope that shirt choice was deliberate.

  • @Tridd666
    @Tridd666 5 років тому

    George Costanza had a kid?

  • @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.