Steamed Quad Trees

Поделиться
HTML-код
  • Опубликовано: 29 сен 2024
  • I was playing around with quadtrees in Python. I popped steamed hams into it and this came out. It's an Albany Algorithm.

Комментарии • 173

  • @not_estains
    @not_estains 3 месяца назад +1193

    i like how whenever it gets extremely unstable and starts putting pixels everywhere it resets to a low resolution and repeats the cycle again

    • @stanbwonderful
      @stanbwonderful  3 месяца назад +283

      Each cell splits into 4 when the complexity goes over a certain amount, I just had the threshold changing as the loop runs. It resets after a certain amount. I was really just playing around with it, trying new things :)

    • @not_estains
      @not_estains 3 месяца назад +17

      @@stanbwonderful cool

    • @not_estains
      @not_estains 3 месяца назад +18

      @@stanbwonderful what if you made an entire video like this but the entire screen has the filter and the squares don't have borders

    • @stanbwonderful
      @stanbwonderful  3 месяца назад +46

      @@not_estains Yeah, that's how quadtrees are used in video compression. I added the lines so I could see what was being split and what wasn't, I was having fun. Having it only on half of the screen just made it run faster :)

    • @74oshua
      @74oshua 3 месяца назад +7

      ​@@stanbwonderfulThat's really interesting, actually. I learned about quadtrees while writing a physics simulation, very cool to learn it has such a widespread application. Thanks for sharing!

  • @Stephillpotten
    @Stephillpotten 3 месяца назад +1

    I think I know how to use spin now

  • @jean-philippe7268
    @jean-philippe7268 3 месяца назад +7

    Hi! What can you do with this quad trees?

    • @stanbwonderful
      @stanbwonderful  3 месяца назад +3

      en.wikipedia.org/wiki/Quadtree

    • @stanbwonderful
      @stanbwonderful  3 месяца назад +14

      Quadtrees are used to break up lists of data into smaller bits which are quicker and easier for the computer to deal with. In this case I'm using quadtrees to do video compression, you used to see this a lot on old digital video clips.

    • @nolansomers
      @nolansomers 3 месяца назад +3

      @@stanbwonderfulpretty interesting, I had no idea about quad trees till now.

    • @stanbwonderful
      @stanbwonderful  3 месяца назад +4

      @@nolansomers A while ago I was learning about the boids algorithm (videos on my channel), that's when I learned about quadtrees as a way to speed things up but giving the computer less to work out with each step.

  • @-YELDAH
    @-YELDAH 3 месяца назад +632

    How can i laugh at this? There's no firetruck!

    • @CasualLemmonJuice
      @CasualLemmonJuice 2 месяца назад +20

      Well dam you spoiled it

    • @brianjones9780
      @brianjones9780 2 месяца назад +10

      Thank you for saving me a couple minutes I almost watched this whole thing 🧐😒

  • @wdelgenio
    @wdelgenio 3 месяца назад +392

    Well, I'm from Utica and I've never heard anyone mention the 'Albany Algorithm'.

    • @stanbwonderful
      @stanbwonderful  2 месяца назад +62

      Gosh no, not in Utica...or in Shelbyville

    • @danielthecake8617
      @danielthecake8617 2 месяца назад +8

      It's an Albany expression.

    • @aebisdecunter
      @aebisdecunter 2 месяца назад

      For the longest time I thought he was saying "Eunucha". Idk how a place could get that name, but I've heard weirder ones.

  • @FezTheSpaceBiker
    @FezTheSpaceBiker 3 месяца назад +189

    Sega CD compression be like

  • @francisconikotian2326
    @francisconikotian2326 3 месяца назад +223

    this is how video compression works I imagine

    • @stanbwonderful
      @stanbwonderful  3 месяца назад +97

      That's what I was aiming for :)

    • @webx135
      @webx135 3 месяца назад +44

      Yes, but also no. But kinda yes.

    • @NinjaBartender
      @NinjaBartender 2 месяца назад +12

      @@stanbwonderful could i have the link to the program please?

    • @G8tr1522
      @G8tr1522 2 месяца назад +2

      i was about to ask this same exact question

    • @stanbwonderful
      @stanbwonderful  2 месяца назад +16

      @@NinjaBartender it's a python script I wrote, not a program as such...and I'm kinda crap at this so it's messy as all heck, but I'm learning :)

  • @NateTheGnat
    @NateTheGnat 3 месяца назад +127

    Looks more like a Utica Algorithm to me…. 🤔

    • @stanbwonderful
      @stanbwonderful  3 месяца назад +16

      Oooooh I don't know Utica! :o

    • @stanbwonderful
      @stanbwonderful  3 месяца назад +39

      I'm a dimbulb, took me a while to work out what Utica meant...heard a billion times but never seen it written down :P

    • @xaigamer3129
      @xaigamer3129 3 месяца назад +43

      oh not in utica no, it’s an albany algorithm

    • @shoebill4902
      @shoebill4902 2 месяца назад +6

      ​@@xaigamer3129I see...

    • @SlabFor1
      @SlabFor1 2 месяца назад

      @@shoebill4902 You know these algorithms are similar to the ones they have at Krusty burger

  • @Paddylol
    @Paddylol 3 месяца назад +175

    love how the reset was timed perfectly with "GOOD LORD WHAT IS HAPPENING IN THERE?!"

  • @scroll_serpent
    @scroll_serpent 3 месяца назад +228

    new aesthetic just dropped

  • @wtch-1tn
    @wtch-1tn 3 месяца назад +79

    ''well seymor we are mosaics''

  • @calicust
    @calicust 2 месяца назад +18

    can we get a version where the bottom left and top right are also quad trees, and all the black lines are hidden? i wanna see the division in real time

  • @blacklight683
    @blacklight683 2 месяца назад +2

    Huh the blocks makes me feel like its how youtube's video compression works

  • @OrangeHarrisonRB3
    @OrangeHarrisonRB3 3 месяца назад +32

    The Albany Algorithm is my favorite dance step

  • @1marcelfilms
    @1marcelfilms 3 месяца назад +28

    POV a bird sits on the dish

  • @IndigoVoltage
    @IndigoVoltage 3 месяца назад +14

    > Pablo Picasso liked that

  • @GenericSweetener
    @GenericSweetener 3 месяца назад +40

    Lovely work, good to see some proper mathematics applied to this. It really legitimizes the field of steaming hams

  • @t65bx25
    @t65bx25 2 месяца назад +2

    Zip file for dummies

  • @goldensunrayspone
    @goldensunrayspone 3 месяца назад +65

    I wonder how this would look on bad apple

  • @harrisonmoore3841
    @harrisonmoore3841 3 месяца назад +9

    I have no idea what I'm looking at, but I like it

    • @whwhwhhwhhhwhdldkjdsnsjsks6544
      @whwhwhhwhhhwhdldkjdsnsjsks6544 2 месяца назад +1

      If the colour differences in a cell are greater than a certain threshold, it splits it into four smaller cells

    • @h2knad
      @h2knad 2 месяца назад

      @@whwhwhhwhhhwhdldkjdsnsjsks6544i still dont get it

  • @hoagie911
    @hoagie911 2 месяца назад +2

    this sucks

  • @mandrillsass5687
    @mandrillsass5687 2 месяца назад +3

    I don't know what happened to me but since last week i seem to have watched hundreds of variation of "steamed hams"

  • @superschizoscriptures
    @superschizoscriptures 2 месяца назад +1

    i wonder if this is a viable compression format id love to see the data output size of this and a video fully encoded all 4 quadrants

    • @stanbwonderful
      @stanbwonderful  2 месяца назад +1

      The output file isn't any smaller than the original file I used, the stupid python script I wrote doesn't work for video compression and it takes ages to render anything. Real programmers who know what they're doing can use algorithms like this in the real world, I'm just having fun learning things :)

  • @daviio
    @daviio 2 месяца назад +1

    whats the result of the equation

  • @blockshift758
    @blockshift758 2 месяца назад +1

    Can you do some apple. Bad apple

  • @CHAZZRMAN
    @CHAZZRMAN 2 месяца назад +1

    why is the compression only in the top left and bottom right corners?

    • @stanbwonderful
      @stanbwonderful  2 месяца назад

      to make it render quicker and so I could see the before and after at the same time

  • @jaredf6205
    @jaredf6205 2 месяца назад +1

    Do it with all 4 corners and with no black outlines for borders

    • @stanbwonderful
      @stanbwonderful  2 месяца назад +1

      Done, the new files is uploaded on my videos page if you want to look.

  • @AlbySilly
    @AlbySilly 2 месяца назад +3

    Without the outlines it would really just look like crusty jpg compression... I kinda wanna see a video where the full frame is a quad tree instead of two quarters being quad and the other two being normal

    • @stanbwonderful
      @stanbwonderful  2 месяца назад

      I'm working on it, should have that video up soonish...it's taking ages to render :P

    • @stanbwonderful
      @stanbwonderful  2 месяца назад

      And done
      ruclips.net/video/nDo-aZMijG4/видео.html

  • @formallizard7085
    @formallizard7085 2 месяца назад +1

    Isn’t this what jpeg compression does?

    • @stanbwonderful
      @stanbwonderful  2 месяца назад

      If you look at the wikipedia page on quadtrees it should a little animated gif showing how it's used for video compression, that's where I got the idea, I kinda reverse engeneered what I saw. That's as deep as my knowledge of video compressions goes

  • @TheRMeerkerk
    @TheRMeerkerk 2 месяца назад +1

    Why does the quality sometimes drop behind those quad trees?

    • @stanbwonderful
      @stanbwonderful  2 месяца назад

      The quality threshold is changing as it loops then it resets and starts over

  • @fonsworththethird
    @fonsworththethird 2 месяца назад +1

    2:15 uk that one time in may

  • @pepperypeppers2755
    @pepperypeppers2755 3 месяца назад +12

    Can you apply this effect to the entire frame?

    • @stanbwonderful
      @stanbwonderful  3 месяца назад +6

      Yeah, I was just playing around with this one, running the algorithm on different parts of the screen and changing the variables a bit. I think I've got a few more vids on my channel.

    • @stanbwonderful
      @stanbwonderful  3 месяца назад +3

      ruclips.net/video/2odCJyeKScs/видео.html

    • @stanbwonderful
      @stanbwonderful  3 месяца назад +3

      ruclips.net/video/OF3pJb8aBUk/видео.html

    • @stanbwonderful
      @stanbwonderful  2 месяца назад

      ruclips.net/video/nDo-aZMijG4/видео.html
      Done :)

  • @blackpanther6389
    @blackpanther6389 2 месяца назад +1

    Cool! Been wanting to play with quadtrees more and eventually move into octrees. Even the quadtrees im having a difficult time wrapping my head around implementation, but your example shows well ehat it can do.

    • @stanbwonderful
      @stanbwonderful  2 месяца назад

      Yeah, took me a while to get it working, there's a load of tutorials around to help

  • @Cool_kid_the_real
    @Cool_kid_the_real 2 месяца назад +1

    1:39

  • @fireball9670
    @fireball9670 3 месяца назад +4

    Getting pop-up windows on bspwm

  • @TenTwentyonemusic
    @TenTwentyonemusic 2 месяца назад +1

    Me when internet

  • @FoxDog1080
    @FoxDog1080 2 месяца назад +1

    Compression

  • @avus-kw2f213
    @avus-kw2f213 2 месяца назад +1

    Interesting

  • @samueltrusik3251
    @samueltrusik3251 2 месяца назад +1

    love it.

  • @marcelguinhos9022
    @marcelguinhos9022 3 месяца назад +1

    Can you actually do compression with this?

    • @stanbwonderful
      @stanbwonderful  2 месяца назад +1

      Proper programmers can and do, I'm still learning and just having fun. Have a look at the quadtree wikipedia page, that's where I got the idea to try it on images.

    • @flameofthephoenix8395
      @flameofthephoenix8395 2 месяца назад

      Probably if you wanted to compress a video with a basic approach you could compress each frame individually, simply start with a very large rectangle covering the whole screen, then find the average color of the pixels in this rectangle, next you calculate how much each pixel deviates from this color squared, then find the average squared value, if the average squared value is greater than a given amount you'll split the rectangle up to down every two iterations and right to left every other iteration otherwise you'll just render the rectangle as the average color, both of the split off rectangles will perform the same calculation as the original one. However, you can also account for the fact that there's a good chance that the image won't be very different from the next image in the video since it is a video as opposed to a series of random images, first compress it in the first frame then just sample random rectangles to do calculations on a second time, if a certain number of the sampled rectangles ended up splitting or re-joining then you'll have to redo the whole quadtree on the frame. You may want to sample rectangles that have been recently altered or are nearby rectangles that have recently been altered.

  • @PersonManManManMan
    @PersonManManManMan 2 месяца назад +1

    Nice quadratic tree steamin!

    • @stanbwonderful
      @stanbwonderful  2 месяца назад

      Thanks, I steamed it myself...I'm steaming Lindenmayer trees as we speak :)

  • @UntiGuy
    @UntiGuy 3 месяца назад +1

    so thats how they make jpeg compression /c:

    • @stanbwonderful
      @stanbwonderful  2 месяца назад

      Possibly, I'm not sure exactly. I recon there's a whole bunch of different algorithms being used.

    • @PianoGamer64
      @PianoGamer64 2 месяца назад

      It's used to partion entities such as those in physics engines to reduce the number of pairwise interactions to compute. For jpg they use Fourier transform and cut the shortest wavelengths I think.

  • @binarix128
    @binarix128 2 месяца назад +1

    This reminds me how HEVC compression works.

  • @orvilleredenpiller338
    @orvilleredenpiller338 2 месяца назад +3

    Supernintendo Chalmers.

  • @chexo3
    @chexo3 2 месяца назад +1

    I don’t get how this works

    • @stanbwonderful
      @stanbwonderful  2 месяца назад

      do a search on youtube for 'quadtree', there are a bunch of videos that can explain it better than I can.

  • @Salutethesun2
    @Salutethesun2 2 месяца назад +3

    Steqmed hams but Semour used the golden rotation to cook his roast

  • @avus-kw2f213
    @avus-kw2f213 2 месяца назад +1

    Extremely interesting

  • @Kreypossukr
    @Kreypossukr 2 месяца назад

    Can somebody explains to me how this works 😅

  • @naphta2630
    @naphta2630 2 месяца назад

    How DXT3 compression looks like when zoomed in

  • @mrosskne
    @mrosskne 2 месяца назад +1

    what's a quad tree?

    • @stanbwonderful
      @stanbwonderful  2 месяца назад

      it's all to do with breaking things up by dividing them by 4

  • @NoenD_io
    @NoenD_io 2 месяца назад +1

    Guys there was a webcam online thing with the same effect pls help what was it

  • @Demanteq
    @Demanteq 2 месяца назад +1

    All the black outlines on characters ate qeirdly thicker on this filter.

  • @chox7517
    @chox7517 3 месяца назад +12

    This actually reminds me of video compression tbh

  • @underarmbowlingincidentof1981
    @underarmbowlingincidentof1981 3 месяца назад +6

    beautiful !!

  • @cq.cumber_offishial
    @cq.cumber_offishial 3 месяца назад +2

    looking like a jpeg

  • @scrung
    @scrung 2 месяца назад +1

    wow thanks for visualizing video compression by redundancy for me, didnt think id learn this today

  • @sunfishensunfishen2271
    @sunfishensunfishen2271 2 месяца назад +1

    RUclips compression algorithm be like

  • @Blaineworld
    @Blaineworld 3 месяца назад +1

    so if i understand correctly, each rectangle can contain either a color or two other rectangles

    • @stanbwonderful
      @stanbwonderful  3 месяца назад +1

      Each cell gets scanned pixel by pixel and a bit of number crunching is done to see how much colour variation there is in that cell. If the colour variation is over a certain threshold it gets split into four smaller cells. If you want to learn more you can give it a search, there's a whole bunch of videos about it here on youtube.

  • @LandonEmma
    @LandonEmma 3 месяца назад +1

    I use Python but IDK what that quadtrees module, I gotta do this now

    • @stanbwonderful
      @stanbwonderful  3 месяца назад

      There's all kinds of tutorials online, just give it a goog and have fun :)

  • @solemnwaltz
    @solemnwaltz 3 месяца назад +1

    It would look cooler without the borders

    • @stanbwonderful
      @stanbwonderful  3 месяца назад

      Yeah, agreed...at the time I was just having fun playing around with the code and wanted to be able to see what it was doing when I changed things :)

    • @stanbwonderful
      @stanbwonderful  2 месяца назад

      ruclips.net/video/nDo-aZMijG4/видео.html

  • @suhnih4076
    @suhnih4076 3 месяца назад +2

    Damn

  • @Candyapplebone
    @Candyapplebone 2 месяца назад +1

    Man i was obsessed with quad trees when i was learning how to program

  • @TheDZHEX
    @TheDZHEX 3 месяца назад +1

    no firetruck... sad

    • @stanbwonderful
      @stanbwonderful  3 месяца назад +1

      I'm sorry, I made a terrible mistake, I just hope you can find a way to forgive me :(

  • @robiginal
    @robiginal 2 месяца назад +1

    2:16 Chalmers is just missing a pupil there

  • @eliburke2779
    @eliburke2779 3 месяца назад +13

    i have no idea whats happening but im here for it

    • @stanbwonderful
      @stanbwonderful  3 месяца назад +7

      It's just nerd stuff but I'm having fun :)

    • @notpot6886
      @notpot6886 3 месяца назад

      Matematically correct Steamed Hams

  • @PersonManManManMan
    @PersonManManManMan 2 месяца назад

    (155)

  • @colinlinzer4355
    @colinlinzer4355 2 месяца назад +1

    Bernard

  • @joshuabessire9169
    @joshuabessire9169 3 месяца назад

    Oh! We are out of Ideas for Steamed Hams!
    I didn't say stop.

  • @lewatoaofair2522
    @lewatoaofair2522 3 месяца назад +3

    2:27 Chalmers looks like Alex from A Clockwork Orange.

  • @AJLord
    @AJLord 3 месяца назад

    steamed hams is still alive

  • @fromD7
    @fromD7 3 месяца назад +1

    "Steamed Quad Trees" as if this is some official thing that has any value at all. "Look at me guys I put a bunch of red dots on the screen. This is called dotting now! Oh look I put red dots over Steamed Hams so I'll call the video Steamed Dotting"

    • @Idran
      @Idran 3 месяца назад

      It is, it goes back to the 70s. It's a pretty common algorithm used in things like image compression, collision detection in 2d games, spreadsheet management; it's handy for basically anything that involves working with data arranged in a 2d grid. Like most CS topics, there's a pretty good, well-cited article on Wikipedia about it, but you could also turn up some good info on it just with Google.

    • @fromD7
      @fromD7 3 месяца назад

      @Idran
      Wow and look at the result. Really complex and aesthetic the way it creates a bunch of pixelated squares on the screen. How revolutionary.

    • @stanbwonderful
      @stanbwonderful  2 месяца назад

      If you run Steamed Dotting up the flag pole I'll salute!

  • @thicclasagna
    @thicclasagna 3 месяца назад +3

    when you save an image as a jpeg

  • @UnaturalShadows
    @UnaturalShadows 2 месяца назад +23

    the description is what got my like

  • @dubbynelson
    @dubbynelson 3 месяца назад +2

    with how bloated Python's standard library is there's probably a whole function somewhere in there specifically made to convert an image sequence to quadtrees (and convert it back to video with an audio track via FFMPEG)